This is my regular expression which accept only string and number characters..otherwise it’s say “Only string charactes are allow. ex; a-z or 0-9”.
preg_match("/^[a-zA-Z0-9]+$/", $uname) != 1
$err[] = "Only string charactes are allow. ex; a-z or 0-9";
But if i write a text with space like(text space) then it’s say “Only string charactes are allow. ex; a-z or 0-9”.
Where is wrong in my code.?
put \s in your pattern match [a-zA-Z0-9\s], \s is the space