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