After my recent testing of different array methods - I thought it would be good to test out another often used method - the longhand if...then statement versus the shorthand ternary option.
read more...While reworking some of my older code to help make it more portable (and OO'd) I found myself questioning whether or not to use array_push or the array[] method to add item(s) to an existing array.
read more...I got sick of the fact that checkboxes, like several other form elements, cannot be styled using css. As a result checkboxes in various browsers always appeared differently and were often enough to ruin a nice (otherwise) clean design. As such I came up with this versatile solution:
read more...Some time ago I went down the path of building a simple sms gateway. At the time I wrote a basic blog entry but received numerous requests for a more detailed "how-to"... so here it is.
I based my solution around a basic linux (Ubuntu) server - the machine itself is nothing fancy but is more than capable of handling the sort of load it's getting. The device being used to send/receive SMS messages is an "old" Nokia mobile phone that I have since retired from use as a handset.
read more...When coding a dynamic site, there's often times where using relative paths is not as simple as it should be, especially when using things such as mod_rewrites to change the paths used within a URL. As a result things can often "fall to pieces". Here's an elegant PHP solution that takes all the headaches out of relative, absolute, client-side and server-side paths
read more...Here's a handy PHP function I use for comparing times and displaying the difference in a human-readable format.
The function itself returns the nearest approximate time based on the largest value from: decades, years, months, weeks, days, hours, minutes or seconds
read more...Here's a couple of basic password generating functions I've created which have come in quite handy.
Item 1: Basic random password generator
Item 2: L337-speak password generator
read more...With user-interaction becoming even more of a key focus in web development everyday (especially since the phrase Web 2.0 was coined), animating "objects" within a page has become much more common place.
Rather than rely on technologies such as Flash to animate items, DHTML can provide some impressive effects.
read more...