A First PHP Page in the PHP 4 Era
In a PHP 4-era site, one early lesson was that the server could do part of the work before sending a page to the browser. You can recreate that lesson with a modern local PHP installation and a small script that uses syntax from the period.
Save this as hello.php:
<?php
$name = 'Benjamin';
echo '<h1>Hello, ' . $name . '!</h1>';
?>
From the same folder, start a modern PHP development server with php -S 127.0.0.1:8000 and visit http://127.0.0.1:8000/hello.php. The built-in server command is a modern way to run the lab. It wasn’t part of PHP 4.
View the browser’s page source. You should see the heading HTML the server produced. Change the hard-coded name, then reload to see the server produce a different heading. That difference between the source file and the HTTP response is the part to remember.