If I have a PHP string, how can I determine if it contains at least one non-ASCII character or not, in an efficient way? And by non-ASCII character, I mean any character tha
You can use mb_detect_encoding and check for ASCII:
mb_detect_encoding($str, 'ASCII', true)
This will return false if $str contains at least one non-ASCI character (byte value > 0x7F).
$str