With a few lines of code and a while loop you can list the content of a directory on both Unix and Windows machines.
Calculate the age in years using PHP
A PHP CalculateAge() function created by applying the logic we used previously in C# to calculate the age from a given birth date.
Write a string to a file
This example shows you how to write a string to a file using PHP, and also do some error handling to ensure that your file gets written correctly.
Check if a string ends with another string
A short function that checks whether a passed string ends with another passed string, and returns the answer as a boolean value.
Redirect using PHP
A function that redirects the user to the specified URL by sending the appropriate headers or by using JavaScript if the headers were already sent.
Read content of file or URL into a string
Two examples on how to read the content coming from an URL or from a local file into a string, using PHP.
Parsing a Tab Delimited File
This example code shows you how to parse a tab delimited file (or any other character delimited file for that matter), using PHP.
Get the modified date and time of a file using PHP
An example on how to use the filemtime() function to retrieve the last update date and time of a file.
Array of Street Types and their Abbreviations
A PHP array containing the street types / designations and their canonical form / abbreviation, following the USPS standard.
Array of States and their Territory Code
A PHP array of US state abbreviations and their corresponding territory code, including the leading zero.