jQuery實現的超鏈接提示效果示例【附demo源碼下載】
733
2024-02-18
函數代碼:
<?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_file($value); } } else { $contents_before = file_get_contents($filename); /*$encoding = mb_detect_encoding($contents_before,array('CP936','ASCII','GBK','GB2312','UTF-8')); echo $encoding; if($encoding=='UTF-8') mb_detect_encoding函數不工作 { return; }*/ $contents_after = iconv($input_encoding,$output_encoding,$contents_before); file_put_contents($filename, $contents_after); } } else { echo '參數錯誤'; return false; } } iconv_file('./test'); ?>
注意:把一個文件夾里的文件全部轉碼 只能轉一次 否則全部變亂碼
#免責聲明#
本站[綠夏技術導航]提供的一切軟件、教程和內容信息僅限用于學習和研究目的;不得將上述內容用于商業或者非法用途,否則,一切后果請用戶自負。本站信息來自網絡收集整理,版權爭議與本站無關。您必須在下載后的24個小時之內,從您的電腦或手機中徹底刪除上述內容。如果您喜歡該程序或內容,請支持正版,購買注冊,得到更好的正版服務。我們非常重視版權問題,如有侵權請郵件[admin@lxwl520.com]與我們聯系進行刪除處理。敬請諒解!