The ‘PHP programming’ Archives
Posted June 9, 2004 by

Redirect to another web page using PHP

Redirection from one web page to another is a handy tool. This recipe describes the syntax that causes the client to redirect to another URL.

Category PHP programming

Posted March 20, 2004 by

PHP Conditional Syntax: Using Switch and Case Statements

The switch/case statement offers similar functionality to the if/elseif statement; however, it offers a more elegant solution and has capabilities beyond the if/elseif alternative.

Category PHP programming

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