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

  1. <div class=''> <!--container-->
  2.   <div class='heading'>
  3.     <h1>Exam Results for User</h1>
  4.   </div>
  5.   <br>
  6.   <div class='content-center'>
  7.     <table class='table-auto mx-auto'>
  8.     <?
  9.         $results = array(
  10.     array('name'=>'peter', 'course'=>'coursename one', 'grade'=>'A'),
  11.     array('name'=>'td', 'course'=>'coursename six', 'grade'=>'B'),
  12.     array('name'=>'doe', 'course'=>'coursename five', 'grade'=>'D'),
  13.     array('name'=>'john', 'course'=>'coursename four', 'grade'=>'C'),
  14.     array('name'=>'peter', 'course'=>'coursename THREE', 'grade'=>'D*'),
  15.     array('name'=>'doe', 'course'=>'coursename TWO', 'grade'=>'A*')
  16. );
  17. $first = $results[0]['name'];
  18. echo $first;
  19.     ?>
  20.       <thead>
  21.         <tr>
  22.            <td>
  23.             Academic Year
  24.           </td>
  25.           <td>
  26.             COURSE NAME
  27.           </td>
  28.           <td>
  29.             GRADE
  30.           </td>
  31.         </tr>
  32.       </thead>
  33.  
  34.       <tbody>
  35.         <tr>
  36.           <td>
  37.             2021
  38.           </td>
  39.           <td>
  40.             name of course goes here grade of course goes here grade of course goes here grade of course goes here
  41.           </td>
  42.           <td>
  43.             D
  44.           </td>
  45.         </tr>
  46.  
  47.         <tr>
  48.           <td>
  49.             2022
  50.           </td>
  51.           <td>
  52.            second name of course goes here
  53.           </td>
  54.           <td >
  55.             A
  56.           </td>
  57.         </tr>
  58.         <tr>
  59.           <td>
  60.             2022
  61.           </td>
  62.           <td>
  63.            second name of course goes here
  64.           </td>
  65.           <td >
  66.             A
  67.           </td>
  68.         </tr>
  69.  
  70.         <tr>
  71.           <td>
  72.             2022
  73.           </td>
  74.           <td>
  75.            second name of course goes here
  76.           </td>
  77.           <td >
  78.             A
  79.           </td>
  80.         </tr>
  81.       </tbody>
  82.     </table>
  83.   </div><!--content-centre-->
  84.   <br>
  85.  
  86.   <div class='band'>
  87.     <a class='hover:text-red-500 text-blue-600 visited:text-purple-600' href=''>Download Results Statement</a>
  88.   </div>
  89.   <br>
  90.   <div class='band'>
  91.     <a class='hover:text-red-500 text-blue-600 visited:text-purple-600' href=''>Barton Peveril Candidate Handbook</a>
  92.   </div>
  93.  
  94. </div><!--closing container-->
  95.  
  96.  
  97. <?php
  98. $results = array(
  99.     array('name'=>'peter', 'course'=>'coursename one', 'grade'=>'A'),
  100.     array('name'=>'td', 'course'=>'coursename six', 'grade'=>'B'),
  101.     array('name'=>'doe', 'course'=>'coursename five', 'grade'=>'D'),
  102.     array('name'=>'john', 'course'=>'coursename four', 'grade'=>'C'),
  103.     array('name'=>'peter', 'course'=>'coursename THREE', 'grade'=>'D*'),
  104.     array('name'=>'doe', 'course'=>'coursename TWO', 'grade'=>'A*')
  105. );
  106. $first = $results[0]['name'];
  107. //echo $first;
  108.  
  109.  
  110. ?>
  111.  
File Description
  • phpPlay
  • PHP Code
  • 21 Jul-2021
  • 2.59 Kb
You can Share it: