PHP Pocket Reference, 2nd Edition
Format: PDF / Kindle (mobi) / ePub
Simple, to the point, and compact--in fact, exactly what you've come to expect in an O'Reilly Pocket Reference--the second edition of PHP Pocket Reference is thoroughly updated to include the specifics of PHP 4.
Written by the founder of the PHP Project, Rasmus Lerdorf, PHP Pocket Reference is both a handy 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.
This valuable little book provides an authoritative overview of PHP packed into a pocket-sized guide that's easy to take anywhere. It is also the ideal 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.
is_writeable(string filename) Return true if filename exists and is writeable int link(string target, string link) Create a hard link int linkinfo(string filename) Return the st_dev field of the Unix C stat structure describing the link array lstat(string filename) Return an array that contains information about the file; follows symbolic links int mkdir(string pathname, int mode) Create a directory int pclose(int fp) Close a file pointer opened by popen() int popen(string command, string mode)
previous page page_7 next page > < previous page page_8 next page > Page 8 you need to write to perform certain tasks. For example, say you have an associative array that looks like this: 275b6a5e9472d661cb6b459a3b8307b4.gif $array["abc"] = "Hello"; $array["def"] = "World"; Associative arrays like this are returned by various functions in the PHP modules. mysql_fetch$1u;array() is one example. The indices in the array usually refer to fields or entity names within the context of the
$var="Hello"; $var="World"; Note that when you assign array elements like this, you do not have to use consecutive numbers to index the elements. As a shortcut, PHP allows you to add an element onto the end of an array without specifying an index. For example: 275b6a5e9472d661cb6b459a3b8307b4.gif $var ="Test"; PHP picks the next logical numerical index. In this case, the "Test" element is given the index 2 in our $var array: if the array has non-consecutive elements, PHP selects the
is first used in a script. You can explicitly specify a type using C-style casting. For example: 275b6a5e9472d661cb6b459a3b8307b4.gif $var = (int) "123abc"; Without the (int) in this example, PHP creates a string variable. With the explicit cast, however, we have created an integer variable with a value of 123. The following table shows the available cast operators in PHP: Operators Function (int), (integer) Cast to an integer (real), (double), (float) Cast to a floating point number
language. Control structures are used to control the logical flow through a PHP script. PHP's control structures have two syntaxes that can be used interchangeably. The first form uses C-style curly braces to enclose statement blocks, while the second style uses a more verbose syntax that includes explicit ending statements. The first style is preferable when the control structure is completely within a PHP code block. The second style is useful when the construct spans a large section of