fruits.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.
Result of php executing
Full code of fruits.php.php
- <?php
- # 1. PHP is written first
- $fruits = [
- 'apple',
- 'banana',
- 'pear',
- 'watermelon'
- ];
- $title = 'Website Example';
- # 2. HTML goes last
- ?>
- <html>
- <head>
- <title><?= $title ?></title>
- </head>
- <body>
- <h1>Fruits</h1>
- <ul>
- <?php foreach ($fruits as $fruit): ?>
- <li><?= $fruit ?></li>
- <?php endforeach; ?>
- </ul>
- </body>
- </html>
File Description
- fruits.php
- PHP Code
- 25 Apr-2019
- 378 Bytes
You can Share it:
Latest PHP Pastes