For the verification of a form, to "block" entries such as a simple space or other, I thought of this combination:
function isEmpty($string){
$val = preg_replace('#[^A-Za-z0-9]+#', '', $string) ;
$val = trim($string, '');
return ($string=='') ;
}
This protects entries like: ' ' ,' - ', '. - +', ... On entries like name, profession, ... it's helpful