*
* @param string $str 字符串
*
* @return int
*/
function str_len($str)
{
$length = strlen(preg_replace('/[x00-x7F]/', '', $str));
if ($length)
{
return strlen($str) - $length + intval($length / 3) * 2;
}
else
{
return strlen($str);
}
}