Check if the string is a valid session id

Another article devoted to validation of strings. In this case a function, which validates if the supplied string is a valid session id.

The format is very similar to an md5 hash with only one difference - the session id consists of 26 alphanumeric characters.

Check if the string is a valid GUID

This function checks if the supplied string is a valid GUID.

MSDN defines GUID as "a 128-bit integer (16 bytes) that can be used across all computers and networks wherever a unique identifier is required. Such an identifier has a very low probability of being duplicated."

GUID consists of alphanumeric characters only and is grouped in five groups separated by hyphens as seen in this example:

Check if the string is a valid md5 hash

A function to check if a string is a valid MD5 hash. That means that the string must be 32 characters long and can only consist of letters and numbers.

Send no-cache headers

A function for occasions when you need to ensure that the page is not cached.

Usually developers include a list of header functions at the top of the page to avoid caching. Here is a small function which you can call instead. You will not have to remember all those Last-Modified and Cache-Control statements anymore.

Convert seconds to hours, minutes and seconds (PHP)

Here is a small function that converts number of seconds to an array containing hours, minutes and seconds separately.

Showing 26 - 30 of 32 results