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.



Your result can be seen below.

Result of php executing





Full code of Situation 2 - array.php

  1. <?php
  2.  
  3. $prices = [
  4.     'ITEM_1' => 10,
  5.     'ITEM_2' => 15,
  6.     'ITEM_3' => 108,
  7.     'ITEM_4' => 22,
  8.     'ITEM_5' => 8,
  9. ];
  10.  
  11. $quantities = [
  12.     'ITEM_1' => 5,
  13.     'ITEM_2' => 12,
  14.     'ITEM_3' => 2,
  15.     'ITEM_4' => 25,
  16.     'ITEM_5' => 50,
  17. ];
  18.  
  19. /**
  20.  * @todo calculer le prix total
  21.  */
  22. function calculTotalPrice($prices, $quantities)
  23. {
  24. }
  25.  
  26. echo calculTotalPrice($prices, $quantities);
  27.  
File Description
  • Situation 2 - array
  • PHP Code
  • 01 Feb-2021
  • 379 Bytes
You can Share it: