Else-if - 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 Else-if.php

  1. <?php
  2. if (true) { 
  3.         echo "first" . PHP_EOL;
  4. } elseif (true) { 
  5.         echo "---"; 
  6. } elseif (true) {
  7.         echo "---"; 
  8. }
  9.  
  10. if (false) { 
  11.         echo "---";
  12. } elseif (false) { 
  13.         echo "---"; 
  14. } elseif (true) {
  15.         echo "last" . PHP_EOL; 
  16. }
  17.  
File Description
  • Else-if
  • PHP Code
  • 31 Aug-2022
  • 218 Bytes
You can Share it: