December 2002
Intermediate to advanced
496 pages
9h 40m
English
Like the other languages we’ve studied (and most easy-to-use languages), PHP is whitespace-insensitive. Therefore, this statement:
<? $title="PHP is cool";echo "<title> $title </title>"; ?>
might be clearer if written as this:
<?
$title = "PHP is cool";
echo "<title> $title </title>";
?> Variable names in PHP are case-sensitive—$a is different from $A. Function names (including user-defined functions) are case-insensitive—rose() is equivalent to ROSE() is equivalent to Rose().
As in C, C++, Java, and Perl, statements are terminated by a semicolon. Also as in C, C++, and Java (but not Perl), single-line bodies do not require the curly braces ({}), while multiline bodies do:
<? // one-line bodies do not require the curlies, ...
Read now
Unlock full access