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

  1. <!doctype html>
  2. <html lang = "fr">
  3. <head>
  4.     <meta charset = "utf-8">
  5.     <title>Titre de la page</title>
  6. </head>
  7. <body>
  8.     <!-- contenu de la page web -->
  9.    <!--<img src = "https://wtools.io:images/wtools.svg">-->
  10.     <header style = "height:100px; background-color: rgb(255,170,50)">
  11.         <img src = "https://www.imt-atlantique.fr/sites/default/files/imt-atlantique.png" align="right"; style = "width:150px">
  12.         <?php 
  13.         $time_start = microtime(true); /* car microtime est par défaut une String, il faut donc l'avoir en float*/
  14.         $infos['nom'] = "DUPOND";
  15.         $infos['prenom'] = "Jean";
  16.         $infos['age'] = 25;
  17.         print $infos['nom']."<br>";
  18.         print $infos['prenom']."<br>";
  19.         print $infos['age']."<br>"; 
  20.         $time_end = microtime(true);
  21.         $time = $time_end - $time_start;
  22.         echo "Ce bloc a pris $time secondes pour s'executer\n";
  23.         ?>
  24.         
  25.     </header>
  26.     
  27.     <section style = "height:70%; background-color: white; text-align: left; padding: 1px; margin: 1px; font-family: Helvetica">
  28.         <?php 
  29.             $infos['email'] = "[email protected]";
  30.             echo 'Courriel : <a href="mailto:'.$infos['email'].'">[email protected]</a>'."<br>";
  31.             $infos['url'] = "http://www.jeandupond.fr";
  32.             echo 'Page perso : <a href='.$infos['url'].'>http://www.jeandupond.fr</a>'."<br>";
  33.             echo 'Ca a pris '.microtime().' s <br>';
  34.         ?>
  35.         Etc... <br>
  36.         <br>
  37.         <br>
  38.         <br>
  39.         </section>
  40.     
  41.     <footer style = "height:15%; background-color: grey; text-align: center;font-family: Arial">
  42.         <f1> 
  43.         <?php
  44.            echo "Nous sommes le ".date('j F Y')." et il est ".date('h\hi A')."<br>"; 
  45.             $time_end = microtime(true);
  46.             $time = $time_end - $time_start;
  47.             echo "Cette page a pris $time secondes pour s'executer\n <br>";
  48.         ?> 
  49.         </f1>
  50.         <f2> <em> &copy 2016-2017 Jean Dupond </f2>
  51.     </footer>
  52. </body>
  53. </html>
File Description
  • dynamique_html-php
  • PHP Code
  • 28 Feb-2024
  • 1.99 Kb
You can Share it: