common
common
Some Common Timestamp Intervals
Fri, 05/02/2008 - 08:45 | by philipnorton42Using timestamps is quite a common practice, but converting them into "real life" times can be a little hard. So here are some common time intervals that you might need.
Common Regular Expressions
Mon, 03/24/2008 - 10:32 | by philipnorton42Here are some of the regular expressions that I frequently use.
Find a blank line
^$
Spaces
[ \t]+
You can use this to break a text string apart into words.
Date
\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}
This will match anything in the format mm/dd/yyyy, or even dd/mm/yyyy.
PHP Array Mode Function
Mon, 01/07/2008 - 10:39 | by philipnorton42The following mode function will return the most commonly occurring value from an array of values, also called the mode. If just the array is used then only the most commonly occurring value will be returned. The second parameter can be used to return an array containing the mode and the number of times that this value occurs in the array.