zadanie1 - 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 zadanie1.php

  1. <?php
  2. $product1 = 'Чайник';
  3. $product2 = 'Кофейник';
  4. $product3 = 'Кипятильник';
  5.  
  6. $price1 = 300;
  7. $price2 = 150;
  8. $price3 = 270;
  9.  
  10. echo $product1.' => '.$price1."\n";
  11. echo $product2.' => '.$price2."\n";
  12. echo $product3.' => '.$price3."\n";
  13.  
  14. $avg = ($price1+$price2+$price3)/3;
  15.  
  16. echo 'средняя цена товара => '.$avg;
File Description
  • zadanie1
  • PHP Code
  • 13 Sep-2022
  • 350 Bytes
You can Share it: