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

  1. <!doctype html>
  2. <?php
  3. $time_start = microtime(true);?>
  4. <html lang = "fr">
  5. <?php
  6.     $infos['nom'] = "Souguir";
  7.     $infos['prenom']="Khalil";
  8.     $infos['age'] = 21;
  9.     $infos['email']="[email protected]";
  10.     ?>
  11. <?php
  12.     $tab[0] = "Football";
  13.     $tab[1]="Tennis";
  14.     $tab[2]="Voyage";
  15.     ?>
  16. <?php $couleur = array("B" =>"blue","G"=>"green"); ?>
  17.  
  18. <head>
  19.     <meta charset="utf-8">
  20.     <title>Carte</title>
  21. </head>
  22. <body>
  23.     <header style ="height : 20%;background-color: rgb(200,59,110)">
  24.         <img  style="height : 120px;float:right" src="https://media.licdn.com/dms/image/D4D03AQGfb3vmQcwyXA/profile-displayphoto-shrink_200_200/0/1708978191450?e=1714608000&v=beta&t=wotsRd5tMXrKxwqQLYKB9htUVgUTfp5C6xtt2bOLU5k">
  25.         <h1><?php echo $infos['nom'].' '.$infos['prenom']; ?>
  26.         </h1> <br>
  27.         <h3 style="color:<?php echo $couleur["B"]; ?>">21 ans</h3> 
  28.     </header>
  29.     <section style="height : 70%;clear:both;font-family : sans-serif" ><br><strong><em>Adresses Utiles</em></strong><br>    
  30.     <p>Courriel : <a href="mailto:[email protected]"> [email protected] </a></p>
  31.     <p> <a href ="https://www.linkedin.com/in/khalilsouguir">Page Linkedin </a>/</p>
  32.     <ul>
  33.     <?php
  34.     foreach ($tab as $value){
  35.     echo '<li>'.$value.'</li>';
  36.     } ?>
  37.     </ul>
  38.     <ul>
  39.     <?php
  40.     foreach ($couleur as $key => $value){
  41.     echo '<li>'.'Element['.$key.']'.' '.$value.'</li>';
  42.     } ?>
  43.     </ul>
  44.     
  45.     </section>
  46.  
  47.     <footer height = 10%>&copy 2023-2024 Souguir Khalil <br>
  48.     <?php echo "nous sommes le ". date('l \t\h\e jS')." et il est " . date('H\hm'); ?>
  49.     </footer>
  50.  
  51. </body>
  52. </html>
  53. <?php $time_end = microtime(true);
  54. $time = $time_end - $time_start;
  55. echo "time taken is ". $time ."ms" ; ?>
  56.  
  57.  
File Description
  • Carte
  • PHP Code
  • 28 Feb-2024
  • 1.7 Kb
You can Share it: