PHP

Posts about the server side scripting language PHP

PHP Easter Eggs

Wednesday, March 26, 2008 - 15:35

There are a couple of hidden features that you can see on just about any PHP driven website. You can get either an image or a list of credits for PHP by appending one of the following strings to the end of the URL.

Category: 

The glob() Function In PHP

Tuesday, March 25, 2008 - 12:12

The glob() function in PHP uses simple pattern matching to find files and directories in a directory and return those file names as an array. It simplifies all of the PHP directory functions, so instead of opening the directory and then reading every file name one by one, you can just use glob() and so it in one function call. Additionally, glob() works very closely with the file system and so it very quick.

Here is a simple example.

Category: 

Save Browser Output To A File With PHP Output Buffering Functions

Wednesday, March 19, 2008 - 10:47

The PHP output buffering functions provide a handy way of intercepting the contents of the buffer before it is sent to the browser. The output is whatever is sent to the browser whenever you print something off. PHP allows you to capture this output in a buffer before it is sent to the browser.

Category: 

A Garbage Collection Mechanism In PHP

Tuesday, March 18, 2008 - 11:33

Garbage collection is a term for a maintenance function in a class or script that you don't want to run every time the script is run. The main function of the script is to clean up anything that the script has used previously, but is now not important in the general running of the system and can be removed with no ill effects. However, it is important that the garbage collection is not run every time the script is run as it may have a detrimental effect on the speed of the system.

Category: 

www.php.net

Monday, March 17, 2008 - 22:07

By far the best resource for finding information about PHP and all of the functions available is from the PHP website. Not only can you view the PHP documentation, but you can also download PHP and many of the extensions like the Smarty template system.

Category: 

PHP5 Filter Functions Part 2

Saturday, March 15, 2008 - 23:16

Following on from the previous post about the PHP filter functions there are two more filter functions that require some extra explanation. These functions are filter_var_array() and filter_input_array().

They work in much the same way as filter_var() and filter_input() but they accept an array as the input. This enables you to sanitize or validate many different variables at the same time.

Category: