php2 - 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 php2.php
- <?php $user = "John";
- $shop = array( array("title"=>"rose", "price"=>1.25 , "number"=>15),
- array("title"=>"daisy", "price"=>0.75 , "number"=>25),
- array("title"=>"orchid", "price"=>1.15 , "number"=>7)
- );
- ?>
- <html>
- <head></head>
- <body>
- Hello <?php echo $user; ?>!
- <?php if (count($shop) > 0): ?>
- <table>
- <thead>
- <tr>
- <th><?php echo implode('</th><th>', array_keys(current($shop))); ?></th>
- </tr>
- </thead>
- <tbody>
- <?php foreach ($shop as $row): array_map('htmlentities', $row); ?>
- <tr>
- <td><?php echo implode('</td><td>', $row); ?></td>
- </tr>
- <?php endforeach; ?>
- </tbody>
- </table>
- <?php endif; ?>
- </body>
- </html>
File Description
- php2
- PHP Code
- 11 Apr-2021
- 692 Bytes
You can Share it:
Latest PHP Pastes