torayeff
torayeff

Reputation: 9702

Comparing UTF8 strings in PHP

Why does this statement return false:

var_dump( 'çorap' === mb_strtolower('Çorap') ); //bool(false) 

How can I compare them or convert first to the second?

Upvotes: 0

Views: 95

Answers (1)

Kevin
Kevin

Reputation: 41885

Try to add an internal encoding on the second parameter of mb_strotolower():

var_dump( 'çorap' === mb_strtolower('Çorap', 'UTF-8') );

Upvotes: 1

Related Questions