I just spent a good half an hour (notice its 4:40am here) hunting down a bug which turned out to be a Capital Y instead of lower case y ....I couldn't figure out why my code kept returning the same result no matter whatt he input. But now I can see its cos I was using a variable that didn't exist and therefore my input was being ignored . BTW this is php so you needn't remind me of option explicit .