We assume that you know some HTML before you embark on your  PHP/Apache/MySQL journey, and you’ve undoubtedly seen how JavaScript code and other languages can be interspersed within the HTML code in an HTML page. What makes PHP so different is that it not only allows HTML pages to be created on the fly, but it is invisible to your Web site visitors. The only thing they see when they view the source of your code is the resulting HTML output. This gives you more security for your PHP code and more flexibility in writing it.

HTML can also be written inside the PHP section of your page; this allows you to format text while keeping blocks of code together. This will also help you write organized, efficient code, and the browser (and, more importantly, the viewer) won’t know the difference.
PHP can also be written as a standalone program, with no HTML at all. This is helpful for storing your connection variables, redirecting your visitors to another page of your site, or performing other functions discussed in this book.