[工具] 文字檔案修改
(h)主要是為了修正phpbb2轉移discuz,造成某些代碼無法在discuz辨識的修正程式,主要是移除代碼後出現的不正常文數字(ex: ---> )
一個不小心,啃完php就把這程式寫出來:song
<?php
echo "開始轉換";
$filename = "file_name.sql";//原始檔案名稱
$fd = fopen( $filename, "r" );
$newname = "newsql2.sql"; //輸出檔案名稱
$fnew = fopen($newname,"w+");
$contents = fread($fd, filesize($filename));
$contents=ereg_replace("img:+", "img", $contents);
echo "文字修正中..........";
$contents=ereg_replace("quote:+", "quote" , $contents);
$contents=ereg_replace("code:+", "code" , $contents);
$contents=ereg_replace("color:+", "color" , $contents);//取代用~
fwrite($fnew,$contents);
fclose( $fd );
fclose( $fnew);
echo "轉換完成!!!";
?>
回覆 #1 ENIX.DQ 的文章
:驚真不愧是咾趙
頁:
[1]