note 120288 deleted from function.utf8-decode by cmb

From: Date: Fri, 26 Oct 2018 20:17:39 +0000
Subject: note 120288 deleted from function.utf8-decode by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-209526@lists.php.net to get a copy of this message
Note Submitter: Alexandru Mazlu ---- This pertains in particular to special characters in strings // utf8_decode converts special characters in already utf8_decoded strings into ?'s // if there are more ?'s in the string after decoding, return the original string, it's probably ok. else, return decoded string private function safe_utf8_decode($string) {     $decoded = utf8_decode($string);     return (substr_count($string, '?') < substr_count($decoded, '?')) ? $string : $decoded; }

« previous php.notes (#209526) next »