Exercice 5-2 - 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.
Result of php executing
Full code of Exercice 5-2.php
- <?php
- function exercice5(array $tab, string $mot) {
- $chech = 0;
- foreach ($tab as $t)
- {
- if ($t == $mot)
- {
- return;
- }
- }
- return false;
- }
- $trouve = exercice5(["paul", "Axel", "Wael"], "Pascal");
- if ($trouve)
- {
- echo "trouvé\n"
- }
- else
- {
- echo "manquant\n"
- }
File Description
- Exercice 5-2
- PHP Code
- 21 Oct-2021
- 323 Bytes
You can Share it:
Latest PHP Pastes