How to convert upper lowercase characters of an html object to their lowercase letters?
$str = "É"; //Γ $res = strtolower( $str ); echo $res;
http://codepad.viper-7.com/Zf3RTe
$str = "É"; //Γ $res = mb_strtolower(html_entity_decode($str,ENT_COMPAT|ENT_HTML401,'UTF-8'),'UTF-8' ); echo $res;
Just use the correct function for it:
$strLower = mb_strtolower($str, 'HTML-ENTITIES');
The PHP extension Multibyte String Docs has an encoding for HTML objects (see the list of all supported Docs encodings for a list ).
Convert hexit to decimal and add 32, convert back to hexit.
Or using mbstring :
mbstring
$res = mb_strtolower(mb_convert_encoding($str, 'UTF-8', 'HTML-ENTITIES'), 'UTF-8')
On my server, I do not have the mbstring extension installed. For a better cross-server solution, you should use this instead:
echo htmlentities(strtoupper(html_entity_decode($str)));