Advertisement
infarh

check_encoding

Oct 14th, 2014
688
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.29 KB | None | 0 0
  1. $string = 'привет, мир!';
  2.  
  3. function check_encoding($string) {
  4.   $encodings = mb_list_encodings();
  5.   foreach ($encodings as $encoding) {
  6.     $str[$encoding] = iconv("UTF-8", $encoding, $string);
  7.   }
  8.  return $str;
  9. }
  10.  
  11. echo '<pre>';
  12. print_r(check_encoding($string));
  13. echo '</pre>';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement