i want to check if string has other than spaces,underscore,digit and character.
i have created the following code.But this is not working when i add any other special character or hyphen.
For example take this string.Now this is not valid.when i remove #%#% from string valid.
$string = 'a1uper___ w__#%#%';
if(preg_match('/[a-zA-Z_]/',$string)){
echo 'valid';
}
else{
echo 'not valid';
}
I have tried the following pattern also:
'/[a-zA-Z_]/'
'/^[a-zA-Z_]/'
'/[a-z][A-Z][_]/',...
please help