Forum Moderators: coopster
I'm trying to fine-tune my validation functions and am starting with empty text and textfield submissions.
So far I've got a very simple function that just checks if the value submitted is empty, or contains 1 empty space character:
function isEmpty($string)
{
return empty($string) ¦¦ $string == ' '? 1 : 0;
}
Right now, if the user inputs 2 or more space characters this function returns FALSE (the field has content) which is not what I want. Ideally, I'd like to improve this function up to handle multiple space characters as well as tab, new-line, return characters, etc.
Can someone please help guide me on how I can make this one function as bullet-proof as possible?
Thanks to all in advance!
Neophyte