Exercice 5 - 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 Exercice 5.php

  1. <?php
  2. function exercice5(array $tab, string $mot) {
  3.     $chech = 0;
  4.     
  5.     foreach ($tab as $t)
  6.     {
  7.         if ($t == $mot)
  8.         {
  9.             echo "trouvé\n";
  10.             return;
  11.         }
  12.     }
  13.         echo "manquant\n";
  14. }
  15.  
  16. exercice5(["paul", "Axel", "Wael"], "Pascal");
  17.  
  18.  
File Description
  • Exercice 5
  • PHP Code
  • 21 Oct-2021
  • 283 Bytes
You can Share it: