Q:

How to check for integers and special charectors in a string?

Iam making a signup page.
And I want to show an error whenever a user puts a numeric/special charector in Name field!
So is there any function that does the same thing?

A:

Can use regex. Example:
$str = 'test';
if(!preg_match('/^[a-zA-Z ]+$/', $str)){
    //echo 'invalid';
}

Regex Demo

