O'Reilly logo

PHP and MySQL for Dynamic Web Sites: Visual Quickpro Guide, Second Edition by Larry Ullman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Basic Syntax

As I mentioned in the book’s introduction, PHP is an HTML-embedded scripting language. What HTML-embedded means is that you can intermingle PHP and HTML code within the same script.

To begin programming with PHP, start with a simple Web page. Script 1.1 gives an example of a no-frills XHTML Transitional document, which I’ll be using as the foundation for every Web page in the book (see Appendix C, “Resources,” for information on XHTML).

Script 1.1. A basic XHTML 1.0 Transitional Web document.

To place PHP code within this document, you surround the code with PHP tags, either the formal and preferred

<?php

?>

or the informal

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required