【文件属性】:
文件名称:php批量转换文件夹下所有文件编码的函数类
文件大小:21KB
文件格式:PDF
更新时间:2020-12-20 00:12:41
hp php php类
函数代码:
<?php
/**
* 把一个文件夹里的文件全部转码 只能转一次 否则全部变乱码
* @param string $filename
*/
function iconv_file($filename,$input_encoding='gbk',$output_encoding='utf-8')
{
if(file_exists($filename))
{
if(is_dir($filename))
{
foreach (glob("$filename/*") as $key=>$value)
{
iconv_f