Quick eregi syntax help
Posted: Mon Mar 10, 2003 4:39 pm
Hi Php's
Im pulling my hair out on this, It should be easy but my syntax sucks.
I need to check that a string allows only numbers, letters and or spaces...
I tried a bunch of |\s and |\t stuff but I dont know what the hell Im doing.
How do I allow spaces or other characters anywhere in the string?
Any tweaking would be most appreciated.
Thaks a Mill
Virgil
Im pulling my hair out on this, It should be easy but my syntax sucks.
I need to check that a string allows only numbers, letters and or spaces...
I tried a bunch of |\s and |\t stuff but I dont know what the hell Im doing.
Code: Select all
$namelength=strlen($name);
if (eregi("її:alnum:]]{" . $namelength . "}", $name)){
$d = TRUE;
}else{
$d = FALSE;
$messageї] = "Please enter a valid name.";Any tweaking would be most appreciated.
Thaks a Mill
Virgil