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

  1. <?php
  2. $array = array( 'film' => array( 'Iron-man', 'Banlieue 13', 'Titanic' ),
  3.                 'genre' => array( 'Science-fiction', 'Science-fiction', 'drame romantique' ),
  4.                 'pays' => array( 'USA', 'france', 'USA' ) );
  5.  
  6. foreach( $array as $key => $value )
  7. {
  8.   echo $key . ': <br />';
  9.  
  10.   foreach( $value as $valeur )
  11.     echo '  ' . $valeur . '<br />';
  12.    
  13.   echo '<br />';
  14. }
  15. ?>
  16.  
  17. <?php 
  18.  
  19. $tab = [
  20. "Leclair" => [
  21. "prenom" => "Marie",
  22. "ville de residence"=> "Nanterre",
  23. "age" => "45"
  24. ],
  25. "Rentier" => [
  26.   "prenom" => "Paul",
  27.   "ville de residence"=> "Marseille",
  28.   "age" => "21"
  29. ],
  30. "Lecache" => [
  31.   "prenom" => "Nadine",
  32.   "ville de residence"=> "Toulon",
  33.   "age" => "37"
  34. ]];
  35.  
  36. echo "<pre>";
  37. print_r($tab) ;
  38. echo "</pre>";
  39. ?>
File Description
  • pikachu13
  • PHP Code
  • 04 Aug-2022
  • 736 Bytes
You can Share it: