php将编码转换为UTF8
主要用于编码不统一导致出现乱码的情况,此函数会自动监测非UTF8编码转成UTF8编码。
function ConverCode($str){
$encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
$newstr = mb_convert_encoding($str, 'UTF-8', $encode);
return $newstr;
}
主要用于编码不统一导致出现乱码的情况,此函数会自动监测非UTF8编码转成UTF8编码。
function ConverCode($str){
$encode = mb_detect_encoding($str, array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
$newstr = mb_convert_encoding($str, 'UTF-8', $encode);
return $newstr;
}使用方法:加密 $txt="ytecn"; $pubkey="公钥" $macdata = RSAEn...
对string进行分割,并取某项数据。应用案例$txt="姓名|电话|手机号|豫唐"; $name=SplitAndGet($txt,"|",3); ech...
获取目录下所有子目录的文件夹列表(递归函数返回的是路径的全称)应用案例$url="D:/wwwroot/ytecn.com/ui/"; $list=RemoveMoreSpace...
获取文件后缀名,识别当前文件是什么类型的。应用案例$url="1.txt"; $name=GetFileExt($url); print_r($name);输出结果为:txt函...
获取文件的权限,权限格式分为数值格式(如0644)和字符表达格式(如-rw-r--r--)两种数值格式应用案例$url="1.txt"; $name=GetFilePermsOc...