PHP Pocket Reference
|
| List Price: | £7.50 |
| Price: | £4.28 & eligible for FREE Super Saver Delivery. Details |
Availability: Usually dispatched within 24 hours
Dispatched from and sold by Amazon.co.uk
37 new or used available from £2.21
Average customer review:Product Description
This is an introduction to PHP syntax and structure, and a quick reference to the vast array of functions provided by PHP. The quick reference section organizes all the core functions of PHP alphabetically so you can find what you need easily; the slim size means you can keep it handy beside your keyboard for those times when you want to look up a function quickly without closing what you're doing. The book provides an overview of PHP and is intended to be a companion for O'Reilly's comprehensive book on PHP, "Programming PHP". The PHP Pocket Reference an indispensable (and inexpensive ) tool for any serious PHP coder.
Product Details
- Amazon Sales Rank: #64560 in Books
- Published on: 2002-11-11
- Original language: English
- Number of items: 1
- Binding: Paperback
- 144 pages
Editorial Reviews
Amazon.co.uk Review
PHP is attracting a lot of attention as an open-source alternative to Microsoft's Active Server Page technology. PHP scripts run on the server, so there is no browser compatibility issue. It is most often used with the Apache Web server running on Unix, but there is a Windows version as well.
This slim quick reference is a handy companion for all PHP developers. The author, Rasmus Lerdorf, is the creator of PHP, and PHP Pocket Reference is truly authoritative. It does not assume any prior knowledge and explains basics like how to embed PHP script in HTML, how to use variables, which data types PHP supports, all the PHP operators, and control structures such as if statements and while loops. There are examples of form handling and integration with the MySQL database server, often used with PHP. The book continues with a comprehensive reference to all the PHP functions, organized by function type. Categories include ODBC, Oracle, Date and Time, Graphics, Encryption and XML.
PHP Pocket Reference is best suited to experienced programmers. One annoying feature is the lack of an index, although with only just over 100 pages it isn't too difficult to find what you are looking for.--Tim Anderson
About the Author
started the PHP Project back in 1995 and has been actively involved in PHP development ever since. Also involved in a number of other Open Source projects, Rasmus is a longtime Apache contributor and foundation member. He is the author of the first edition of the PHP Pocket Reference, and the co-author of Programming PHP.
Excerpted from PHP Pocket Reference by Rasmus Lerdorf. Copyright © 2000. Reprinted by permission. All rights reserved.
Introduction
PHP is a server-side, HTML-embedded, cross-platform scripting language--quite a mouthful. In simpler terms, PHP provides a way for you to put instructions in your HTML files to create dynamic content. These instructions are read and parsed by the web server; they never actually make it to the browser that is displaying the page. The web server replaces your PHP code with the content that the code was written to produce.
PHP can be configured to run either as a server module or as a standalone CGI script. At the time of this writing, the server-module version is only production-ready for the Apache web server on Unix systems. The CGI version runs with all web servers on both Unix and Windows 95/98/NT. On the Windows platform (as of PHP Version 4), the server module is being developed to work with ISAPI, NSAPI, and WSAPI, which means the server module will eventually work with Microsoft's IIS, Netscape's Enterprise Server, and O'Reilly's WebSite.
The PHP language itself borrows concepts from other common languages, such as C and Perl. If you have some experience with one of these languages, you should feel right at home with PHP. In addition to the core language, PHP provides a wide variety of functions that support everything from array manipulation to regular expression support.
Database connectivity is one popular use for PHP. PHP supports a large number of databases natively and many others are accessible through PHP's ODBC functions. Through this database connectivity, it is possible, for example, to take a company's database of products and write a web interface to it using PHP.
This book provides an overview of the core PHP language and contains summaries of all the functions available in PHP. The material covers PHP 3.0.
Installation and Configuration
PHP Version 3 can be installed in two primary ways: as an Apache module on Unix systems or as a CGI script on both Unix and Windows systems. See the installation instructions that come with PHP for full and current information.
When you are using PHP as an Apache module, PHP processing is triggered by a special MIME type. This is defined in the Apache configuration file with a line similar to:
AddType application/x-httpd-php3 .php3
This tells Apache to treat all files that end with the .php3 extension as PHP files, which means that any file with that extension is parsed for PHP tags. The actual extension is completely arbitrary and you are free to change it to whatever you wish to use.
If you are running PHP as a dynamic shared object (DSO) module, you also need this line in your Apache configuration file:
LoadModule php3_module modules/libphp3.so
When you are running PHP as a CGI script (with any web server), PHP processing is still triggered by this special MIME type, but a bit more work is needed. The web server needs to know that it has to redirect the request for the PHP MIME type to the CGI version of PHP. With ApacheNT, for example, this redirect is done with a set of configuration lines like the following:
ScriptAlias /php3/ "/path-to-php-dir/php.exe"
AddType application/x-httpd-php3 .php3
Action application/x-httpd-php3 "/php3/php.exe"
For IIS, this redirect is set up through the Windows registry. Refer to the PHP installation instructions for full details.
At runtime, most aspects of PHP can be controlled with the php3.ini file (located in /usr/local/lib by default). For the Apache module version of PHP, this file is read only when the server is started or reinitialized. Changes to this file should be treated the same as changes to Apache's own configuration files. In other words, if you make a change, you need to send your Apache server an HUB or a USR1 signal before the change will take effect.
Many aspects of PHP can also be controlled on a per-directory basis (or even per-location or per-request) when using the Apache module version. Most of the directives available in the php3.ini file are also available as native Apache directives. The name of a particular directive is the php3.ini name with "php3_" prepended. For a list of all available Apache directives, run your Apache httpd binary with the -h switch.
Customer Reviews
More comprehensive and cheaper alternatives are available.
I think that this is a very good book to have by your side when you are coding. You could save money by downloading the PHP documentation from php.net, that is much more comprehensive, and free. One caveat, don't buy this book and O'Reilly's Webmaster in a nutshell (an excellent book) as the latter includes all of php pocket reference and much much more. I did exactly that and was a bit annoyed.
Not the best buy ever
If you are like me, you buy the Pocket Reference books to gain a fast track insight into a particular language or framework. The PHP Pocket Reference does precisely this: the first thirty pages run through all of the core syntax of PHP. These pages alone justify buying the book. The remaining 100 pages of the book take the form of an alphabetical function reference (function signatures together with very brief descriptions). To be honest, this reference is of little to no use. To use it, you either must know the name of the function you wish to look up, or you must make an educated guess at what the function is called. This section of the book would have been infinitely more useful had the author compiled it on a categorical basis in a similar way to the documentation that ships with PHP.
Out of date and lacking a Index, but otherwise useful
This book was written for a late version of PHP3, so when running PHP4 you get annoyed to find that some functions have been removed! Other than that, its very useful. It almost makes up for the lack of a Index by sorting the functions into 3-4 pages per catagory i.e. file handling or mysql database which makes it easy to find what you want.





