Demonstrates how to return multiple values from a function using arrays and list().
A simple hit counter using a file
Using preg_replace to convert non-anchored URLs into HTML hyperlinks.
This class can be used to pick a random item from a collection. It can add to a collection of items that can be values of any type: strings, numbers, objects, etc.. Each item may have a probability weight. The class can pick one or more random items from the collection. When picking multiple items it may allow repetition of the same item or assure that all the picked items are unique. It can also pick random items considering their probability weight, so those with greater weight are more likely to be picked.
Using PHP's bitwise And operator (&), we can check to see if the 1-bit is on or off. If it's on, we have an odd number, otherwise, an even number. We can also accomplish the task by using the modulus operator.
This script contains the easiest mysql connection ever.
Check that a URL or website address is valid using preg_match().
Using the foreach construct to cycle through an array.