Helpful Information
 
 
Category: PHP
Validating whether string contains llegal chars

Could someone please give me a code that will check if a string contains only numerical and alphabetical characacters in it..
ya know..

abcedfghijklmnopqrstuvwxyz
1234567890

$str = 'lkdsaglfkgslfkjagsd';
if (preg_match('/[^\\dA-Za-z]/', $str)) {
die('illegal characters!');
}

- Mark










privacy (GDPR)