コード例 #1
0
ファイル: string.php プロジェクト: cedwards-reisys/nexus-web
 /**
  * Converts a string to the desired character set if possible. Wrapper for the callback
  * @param	string
  * @param	string	Character to convert to
  *
  * @return	string	Character in desired character set or as an HTML entity
  */
 public static function convertStringToCurrentCharset($string)
 {
     return preg_replace_callback('/&#([0-9]+);/i', function ($matches) {
         return vB_String::convertUnicodeCharToCharset($matches[1], vB_String::getCharset());
     }, $string);
 }