| home / new / php |
|
What is PHP?So now that I've whetted your appetite, let's learn some more about PHP. To start off I'll throw some simple PHP code at you (this assumes you understand HTML):
basic.php3 The function of this code is simple. First we start off the document with the normal HTML headers, nothing new there. What is new is the material on lines 6 through 9; here we see simple PHP code which will print out the current date. Here is a line by line explanation of what happens in lines 6 through 9:
Line 6: Tells the PHP preprocessor that the PHP code has begun.
This is like the <html> at the beginning of the document
which tells the Web browser to treat the document as an
HTML language. This is a basic example of PHP's features, and a little bit of source code to give you the idea. This article's purpose is to introduce PHP, rather than write a tutorial on PHP. Subsequently, I'm not covering the syntax in depth but rather giving a taste of the language. Other tasks that PHP is especially good at are database access, disk access, networking and text manipulation. You can find articles that cover these features on the sites listed below.
ConclusionIn this article, we have discussed the motives for using PHP, what PHP is and even gotten into writing some source code. We have also gone over some of the history of PHP. However, this is meant only as an introduction, to help you on your way to becoming an experienced PHP programmer. For more information, I have provided a list of links which will serve to help further your knowledge of PHP. Happy trails!
Links
The Official PHP site - www.php.net Author Info: Stirling Hughes can be reached at stirling@scalarsplit.com, or at www.scalarsplit.com.
Previous: Why Use PHP? This article originally appeared in the October 28, 1999 edition of the WebReference Update Newsletter. |
Comments are
welcome
Written by Stirling Hughes and
Revised: May 16, 2000
URL: http://webreference.com/new/php2.html