Strtolower function in php windows-1254 encoded

I have a page and I have it,

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

when i try to change the line with strtolower(). he does not work on "Γ‡, Γ–, Ü, Ğ, Ş".

Example,
$str= "Γ‡aTPΓ–";
$str = strtolower($str);
//$str = "Γ‡atpΓ–";

Also I am trying to change them using ereg_replace(), but not working again.
$str = ereg_replace("Γ‡","Γ§",$str);
$str = ereg_replace("Γ–","ΓΆ",$str);

so what do you think is the problem?

+3
source share
2 answers

Try mb_strtolower():

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

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

+2
source

The built-in PHP manipulation functions are not multibyte.

Check out the mb_ * functions set .

Edit: Also note: the hedge is deprecated. Use preg instead.

+1
source

Source: https://habr.com/ru/post/1790839/


All Articles