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

  1. <?php
  2.  
  3. $mybook = array('1st'=>'John', '2nd'=>'Ringo', '3rd'=>'George', '4th'=>'Paul');
  4. $frameworks = array('1st'=>'Wordpress', '2nd'=>'Joomla', '3rd'=>'Drupal');
  5. //print_r($mybook);
  6.  
  7.  
  8.  
  9. // loop round array
  10. echo "<p>Choose your favourite CMS framrwork?</p>";
  11. echo "<ol>";
  12. foreach($frameworks as $val){
  13.      echo "<li>$val</li>";
  14. }
  15. echo "</ol>";
  16. $top = $mybook['1st'];
  17.  
  18. echo "<p>$top</p>";
  19.  
  20. echo "<p>{$mybook['1st']}<p>";
File Description
  • phpIntroduction
  • PHP Code
  • 25 Feb-2021
  • 418 Bytes
You can Share it: