From preface of the PHP manual, the following states the definition
of PHP scripting: "PHP is an HTML-embedded scripting language.
... The goal of the language is to allow web developers to write
dynamically generated pages quickly."
The phrase "HTML-embedded scripting language" reminds me of my days
in "dot-coms" ("dot-gones" for now). I was involved in the development
of corporate portal sites. My working counterparts were mainly
webpage and graphic designers with little or no programming knowledge.
Since PHP is a "HTML-embedded scripting language", so it becomes
natural to embed my PHP codes in the web pages designed by the
designer folks. Often, I will have to embed PHP codes in HTML pages
to dynamically display the records which I retrieved from database(es).
Take an "Address Book" application for example. We normally store the address book entries : "Name" and "Address" in database. :
+---------------------------------+
| NAME | Address |
+---------------------------------+
| Alvin | Block 112 Bedok Road |
+---------------------------------+
| Robert | 23 Livingstone Road |
+---------------------------------+
:
:
+---------------------------------+
| John | 556 Everton Park Road |
+---------------------------------+
When the time comes to display them in HTML pages, we will normally insert our PHP codes in the HTML page like this :