兩種文件的文本,我有兩個文本文件,我創造了這個辦法:合併使用PHP
<?php
$lines = file('Country.txt');
$newf = array();
foreach ($lines as $line)
$newf[] = substr($line, 2);
file_put_contents('country2.txt', implode("\n", $newf));
$lines2 = file('countryenglish.txt');
$newf2 = array();
foreach ($lines2 as $line)
$newf2[] = substr($line, 3);
file_put_contents('countryenglish2.txt', implode("\n", $newf2));
?>
兩個顯示數據是這樣的:
Country2.txt:
Text1Data1
text1Data2
text1Data3
>
countryenglish2.txt
Text2Data1
text2Data2
text2Data3
我想顯示:
Text2Data1Text1Data1
text2Data2text1Data2
text2Data3text1Data3
在此先感謝您的幫助!
我覺得OP正在尋找方法,不僅將追加,但備用。 – ConcurrentHashMap 2013-03-07 13:13:45