Blog of Clive

PHP, MySQL, jQuery code, ideas and general developer crap

Browsing Posts tagged php

This function outputs a string that is filename friendly. It removes all non-characters and punctuation from the input and converts to lowercase. I find this useful for seo friendly cms pages. This function is still being tweaked so any improvements would be most appreciated. function checkCharacters($title) {         $final_text = ”;   [...]

This function is great for retrieving the last key of a multidimensional array. I use this function on a site that stores cake options such as size, shape, ribbon colour, icing colour and text fields for use in a shopping basket. Not all cakes have all the options so i need to know where the end of the array is, hence this function.

Following on from my other 2 useful functions I thought I would show you another one which I have found useful for determining if a colour background needs a white or black text colour over the top. I found this function a while back so can’t take the credit for writing it myself, I have [...]

Following from my last post, here is the method to get your IP address if you are behind a proxy. It’s a much better function than the earlier post as it will almost guarantee a return result.

Here’s a quick little function which can be used to return your IP address. Not as useful as the next method but a simple quick solution

Here’s a useful function that I use a lot for taking a database date and converting it into something human readable. It allows custom date formats to be input for custom returns.

Been using this class now for my sites for a while it’s just the ticket. So i thought i’d include it here so that more people can benefit from it. I wish i could take the credit for producing this but unfortunately it was built by Eric Sizemore over at www.secondversion.com he’s also produced a [...]