5fd0dd9d1070e5200.jpg_fo742.png
/**
* 判断字符串是不是utf8 如果不是转成 utf8
*@param string $vector
*@return string $vector
*
*/

function strToUtf8 ($vector)
{
$from_chr= mb_detect_encoding($vector,array('UTF-8','ASCII','EUC-CN','CP936','BIG-5','GB2312','GBK'));
if($from_chr !="UTF-8")
{
$vector = mb_convert_encoding($vector,'UTF-8',array('UTF-8','ASCII','EUC-CN','CP936','BIG-5','GB2312','GBK'));
}
return $vector;
}

发表回复

您的电子邮箱地址不会被公开。

Captcha Code