Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

strtolower function in php with windows-1254 charset

Tags:

string

php

i have page and it has,

<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">

when i try to change string with strtolower(). it is not working on "Ç,Ö,Ü,Ä,Å".

example,
$str= "ÇaTPÖ";
$str = strtolower($str);
//$str = "ÇatpÖ";

also i try to change them with ereg_replace(), but not working again.
$str = ereg_replace("Ç","ç",$str);
$str = ereg_replace("Ö","ö",$str);

so what's the problem do you think?

like image 525
Okan Kocyigit Avatar asked Mar 20 '26 22:03

Okan Kocyigit


1 Answers

Try mb_strtolower():

$str = mb_strtolower($str, 'windows-1254');

http://www.php.net/manual/en/function.mb-strtolower.php

like image 194
Floern Avatar answered Mar 22 '26 11:03

Floern