I have some string in which I would like to check if contains some letters or numbers. Those letters are from a-z, A-Z and all numbers.
So this is the example:
$goodstring = “abcdefg%$#%&asdqwe”;
$badstring = “%$#&%#/&/#$%!#-.”;
check if $goodstring contains letters/numbers and if, then return true.
check if $badstring contains letters/numbers and if not, then return false.
I have also used preg_match, but this works only if there are not some letters/numbers in string.
Here you go (“only” version):
Or (depending on what you want exactly):