Page 1 of 1

Do ctype_digit & ctype_alpha allow spaces?

Posted: Sun Feb 11, 2007 4:31 pm
by impulse()
My string with spaces are failing at the moment while being verified with ctype_alpha, ctype_digit & ctype_alnum. Is there any way to stop them failing or an alternative way to validate data, not using regex as I'm not great with regex.

Regards,

Posted: Sun Feb 11, 2007 5:37 pm
by Christopher
I believe they do not accept spaces. You could get around this by filtering first (e.g. str_replace() or preg_replace()). If you want regexp help this is a great place to ask.

Posted: Sun Feb 11, 2007 6:43 pm
by volka