php将编码转换为UTF8
主要用于编码不统一导致出现乱码的情况,此函数会自动监测非UTF8编码转成UTF8编码。
functionConverCode($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编码。
functionConverCode($str){
$encode=mb_detect_encoding($str,array("ASCII",'UTF-8',"GB2312","GBK",'BIG5'));
$newstr=mb_convert_encoding($str,'UTF-8',$encode);
return$newstr;
}判断当前网站在服务器用的什么环境functionGetWebServer() { if(!isset($_SERVER['SERVER_SOFTWARE'])){ returnS...
远程提交方式:post范围:所有php类型程序函数代码functionpost($params,$url){ $ch=curl_init(); curl_setopt($ch,CURLOPT_UR...
对字段中的连续空格进行删除只保留一个。应用案例$txt="abcytecn1"; $name=RemoveMoreSpaces($sss); echo$name;输出结果为:a...
获取目录下所有子目录的文件夹列表(递归函数返回的是路径的全称)应用案例$url="D:/wwwroot/ytecn.com/ui/"; $list=RemoveMoreSpace...
获取当前目录下文件夹的名称应用案例$url="D:/wwwroot/ytecn.com/ui/"; $list=GetDirsInDir($url); print_r($lis...