Datasheet

10
Part I PHP: The Basics
Figure 1-1: A result of preprocessed PHP
If you peek at the source code from the client browser (select Source or Page Source from the
View menu, or right-click if you’re using the AOL browser), it will look like this:
<HEAD>
<TITLE>Example.com greeting</TITLE>
</HEAD>
<BODY>
<P>Hello,
Ms. Park
. We know who you are! Your first name is Joyce.</P>
<P>You are visiting our site at 2002-04-21 19-34-24</P>
<P>Here is a link to your account management page: <A
HREF=”http://www.example.com/accounts/JoycePark/”>Joyce’s account
management page</A></P>
</BODY>
</HTML>
This code is exactly the same as if you were to write the HTML by hand. So simple!
The HTML-embeddedness of PHP has many helpful consequences:
PHP can quickly be added to code produced by WYSIWYG editors.
PHP lends itself to a division of labor between designers and scripters.
Every line of HTML does not need to be rewritten in a programming language.
PHP can reduce labor costs and increase efficiency due to its shallow learning curve
and ease of use.
Perhaps the sweetest thing of all about embedded scripting languages is that they don’t need
to be compiled into binary code before they can be tested or used just write and run. PHP
is interpreted (as are many newish computer languages), although the Zend Engine does
03 557467 ch01.qxd 4/5/04 11:06 AM Page 10