| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
knocking heads
Join Date: Jul 2003
Location: London, UK
Posts: 1,914
|
php regex help...
I've noticed an annoying bug in the current site I'm building, if spaces are entered into a form field (and nothing else) then technically the field isn't empty and so it manages to get past the error checking. I could use str_replace(" ", "", $thefield) in an if statement to check if it is only spaces, but that seems a bit of an overkill - is there a regex i can do to check if a string contains something other than just spaces so " " would return false (i.e, only spaces) and "fd ad sf" would return true (i.e it's not empty) cheers |
|
|
|
![]() |