This class has been four years in the making. It started as a very simple script when someone asked me to create a way to send email messages between users on their website. Over time, more features were added until it ultimately became what it is today. This class presently supports multiple file attachments, multiple [...]
Sometimes you’ll need to calculate an age. It could be the age of a member on your website… It could be your cat. Either way, this can be useful for a variety of reasons such as personalized messages, criteria-based marketing or any functionality that is based on age demographics. I’ve seen a few different versions [...]
I was recently asked to write a function that implodes a list of items in an array into a human-readable list. For example, [[0] => “Jimmy”, [1] => “Ryan”, [2] => “Ken”, [3] => “Barbie”] would become “Jimmy, Ryan, Ken and Barbie” and [[0] => “apple”, [1] => “banana”] would become “apple and banana”. This [...]
Email addresses are used for everything. Registrations, usernames, lead generation… Everything. They are as unique as a telephone number or physical address and require validation just like any other piece of data. I’ve come across a lot of poorly written email validation scripts, but this one has risen from the ashes in a blazing glory [...]
Have you ever typed a URL into an email or website and a clickable hyperlink was automagically created? Regular expressions, baby! Check it out: This function accepts three arguments; $sInput, $sTarget (optional), and $sClassName (optional). $sInput is the text you would like to search and create hyperlinks for, $sTarget is the target window that hyperlinks [...]
Sometimes you just need to shorten that huge wall of text. Here are two functions that I use frequently to limit the display of lengthy user input: The first function, jTruncate(), truncates text if it is greater than the specified number of characters. For example, if you pass “This is a large block of text!” [...]
|