Situation 2 - array - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of Situation 2 - array.php
- <?php
- $prices = [
- 'ITEM_1' => 10,
- 'ITEM_2' => 15,
- 'ITEM_3' => 108,
- 'ITEM_4' => 22,
- 'ITEM_5' => 8,
- ];
- $quantities = [
- 'ITEM_1' => 5,
- 'ITEM_2' => 12,
- 'ITEM_3' => 2,
- 'ITEM_4' => 25,
- 'ITEM_5' => 50,
- ];
- /**
- * @todo calculer le prix total
- */
- function calculTotalPrice($prices, $quantities)
- {
- }
- echo calculTotalPrice($prices, $quantities);