Understanding PHP, HTML, and White Space

Before I get any further into the depths of using PHP to send HTML and other data to the Web browser, it’s important to comprehend what exactly is occurring. With PHP you can send data (a combination of HTML tags and text) to the Web browser, which will, in turn, display it as the Web page the end user sees. Thus, what you are doing with PHP is creating the HTML source of a Web page. Pictorially, this means PHP is generating that in Figure 1.5 (accessed by choosing View > Source or View > Page Source in your browser), which the Web browser will turn into Figure 1.6.

Figure 1.5. The HTML source of a Web page is what you’ll use PHP to generate...

Figure 1.6. ...which the Web browser knows to turn into ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.