xviii Introduction
I recommend using a text editor that
automatically displays the line numbers for
you—the numbers will help when you’re
debugging your work. In the scripts you’ll
sometimes see particular lines highlighted
in bold, in order to draw attention to new or
relevant material.
Because of the nature of how PHP works,
you need to understand that there are
essentially three views of every script: the
PHP code (e.g., Script i.1), the code that’s
sent to the browser (primarily HTML), and
what the browser displays to the end user.
Where appropriate, sections of or all of the
browser window are revealed, showing the
end result of the exercise
A
. Occasionally,
you’ll also see an image displaying the
HTML source that the browser received
B
.
Yo u c a n n o r m a l l y a c c e s s t h i s v i e w b y
choosing View Source or View Page Source
from the appropriate Web browser menu.
To s u mm ar i ze ,
B
displays the HTML the
browser receives, and
A
demonstrates how
the browser interprets that HTML. Using
PHP, you’ll create the HTML that’s sent to
the browser.
A
This is a sample view you’ll see of the
browser window. For the purposes of this
book, it won’t make any difference which
Web browser or operating system you use.
B
By viewing the
source code received
by the Web browser,
you can see the HTML
created by PHP and
sent by the server.
Because the column in this book is narrower
than the common text editor screen,
sometimes lines of PHP code printed in the
steps have to be broken where they would
not otherwise break in your editor. A small
gray arrow indicates when this kind of break
occurs. For example:
print "This is going to be a longer
➝
line of code.";
Yo u s h ou l d c o n t i nu e t o u s e o n e l i n e in
your scripts, or else you’ll encounter errors
when executing them. (The gray arrow isn’t
used in scripts that are numbered.)
While demonstrating new features and
techniques, I’ll do my best to explain the
why’s and how’s of them as I go. Between
reading about and using a function, you
should clearly comprehend it. Should
something remain confusing, though, this
book contains a number of references where
you can find answers to any questions (see
Appendix B, “Resources and Next Steps”). If
you’re confused by a particular function or
example, your best bet will be to check the
online PHP manual or the book’s supporting
Web site (and its user support forum).