About the app
Another 'Hello World' app.
This time, however, the ubiquitous message is being authored using PHP via an 'echo' command.
From this humble beginning, we are about to explore the whole world.
'Cave of Wonders' Commentary:
After the page loads, RMC the page and view the HTML. Deep within the body, inside the main area, you will find a division marked 'output.' Inside, there lurks an h2 heading. See it? It's written in HTML...but it wasn't originally.
It was originally written in PHP and interpreted by a PHP software engine to render it as HTML in the browser.
It's kinda like we uttered some magic words to a genie in a 'Cave of Wonders' and the genie, eager to serve, magically translated the PHP into HTML for the browser to render.
Here's the command that was imbedded in the original source code of this page, within the div#output:
<?php
echo "<h2>Hello, World!</h2>";
?>
The content showing in red above is the container (aka 'Cave of Wonders, COW') that delimits the PHP commands; the stuff inside the COW are PHP commands that the genie interprets as HTML.
The alert user will notice by viewing the source code that we had to 'escape' characters that have 'code-type' meanings in PHP such as a less than or greater than symbols.
Had we not done so, the page would have attempted to render them as PHP as well!
12/16/19