December 2002
Intermediate to advanced
496 pages
9h 40m
English
PHP has a number of built-in functions. We sample a few, but there is no way we can cover all of them in this overview. See the documents (www.php.net/manual/en/funcref.php) or a suggested book for a complete list.
Let’s start with two important functions: print() and die().
This function outputs a string that ends up being displayed in the browser. For example:
print "<h1>PHP Results</h1>"; print "$name : $age : $result[0]"; print "<hr>";
The print() function is essentially the same as the echo statement. These two do the same thing—they both produce the text “hello, world!”:
echo "hello, world!"; print "hello, world!";
PHP also has the die() function, which outputs ...
Read now
Unlock full access