The Candy Store - 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 The Candy Store.php

  1.  
  2.  
  3. <?php
  4.  
  5. $name = 'Patrick';
  6. $price = 5;
  7. ?>
  8.  
  9.  
  10.  
  11. <!doctype html>
  12. <html>
  13. <head>
  14.  
  15. <title>variables</title>
  16. </head>
  17. <h1>The Candy Store</h1>
  18.         <h2>Welcome <?php echo $name; ?></h2>
  19.         <p>The cost of your candy is
  20.         $<?php echo $price; ?> per pack.</p>
  21.        
  22. </body>
  23. </html>
File Description
  • The Candy Store
  • PHP Code
  • 23 May-2022
  • 259 Bytes
You can Share it: