The ‘PHP programming’ Archives
Posted February 1, 2004 by

PHP Syntax: For Loop Basics

The for loop allows iteration for a fixed number of times.

Category PHP programming

Posted January 4, 2004 by

PHP: determine the directory path of the server root

It is sometimes necessary to refer to files in the host filesystem explicitly. By retrieving this information dynamically instead of hard coding it, moving the code from one server or hosting company to another is much simpler.

Category PHP programming

Posted December 28, 2003 by

PHP syntax: sort an associative array by value with asort

To sort an associative array by the array values, use asort.

Category PHP programming

Posted December 28, 2003 by

PHP syntax: sort an associative array by index keys

To sort an associative array by index values (or keys), use ksort.

Category PHP programming

Posted December 28, 2003 by

PHP syntax: create an associative array

An associative array can use non-numeric index values and are useful because they can be iterated over sequentially and values can be extracted individually by index. Database select results can be returned as associative arrays in which the column names become indicies.

Category PHP programming

Posted December 27, 2003 by

PHP Syntax: Iterate over an Associative Array

An associative array stores an arbitrary index in addition to the values. This is useful for storing configuration information such as in the $_SERVER array.

Category PHP programming

Posted December 27, 2003 by

PHP syntax: iterate over an array

Category PHP programming

Posted December 27, 2003 by

PHP conditional syntax: less than

Category PHP programming

Posted December 27, 2003 by

PHP comparison syntax: equality

The equality comparison is a fundamental operation in programming languages. In PHP, to evaluate if one expression is equal to another, use the == comparison as described in this Tech-Recipe.

Category PHP programming

Posted December 27, 2003 by

PHP if statement syntax

Examples of using the “if” command in PHP.

Category PHP programming