clarkk clarkk - 1 year ago 50
PHP Question

stristr with special chars æøåü etc

Why is this not a match?

$str = 'Bülow';

if(stristr($str, 'BÜLOW')){
echo 'match';
echo 'no match';


same problem with

echo strtolower('BÜLOW'); // returns: bÜlow

Answer Source

Use mb_* functions because they can operate on multi byte characters. PHP's strings are really byte arrays. They don't know what a character is.