note 89689 modified in function.utf8-encode by danbrown

From: Date: Thu, 19 Mar 2009 13:14:07 +0000
Subject: note 89689 modified in function.utf8-encode by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-152140@lists.php.net to get a copy of this message
I use a function like this, rather than utf8_encode() alone, for fixing the encoding of unknown data, for example the contents of get_meta_tags(): <?php function FixEncoding($x){ if(mb_detect_encoding($x)=='UTF-8'){ return $x; }else{ return utf8_encode($x); } } ?> --was-- I use a function like this, rather than utf8_encode() alone, for fixing the encoding of unknown data, for example the contents of get_meta_tags(): function FixEncoding($x){ if(mb_detect_encoding($x)=='UTF-8'){ return $x; }else{ return utf8_encode($x); } } http://php.net/manual/en/function.utf8-encode.php

« previous php.notes (#152140) next »