PHP convert between charsets Win-1251 and utf-8
This procedures shows how to convert formats between database or other charsets in PHP Procedure to convert from windows-1251 to utf-8
1 2 3 4 5 6 |
function dbconv($name){ $name=iconv("CP1251//IGNORE", "UTF-8", $name); return $name; }; |
procedure to convert from utf-8 to cp-1251
1 2 3 4 5 |
function dbconv2($name){ $name=iconv( "UTF-8","CP1251//IGNORE", $name); return $name; }; |