File merge
Posted: Wed Feb 28, 2007 3:14 pm
Hi,
I'm trying to merge 3 files into one by doing the below:
This would be fine if the files only contained 3 lines, but the file will often contain more lines and i was thinking of using a foreach but unsure how to do it so that it echo's in this format:
Joe, Bloggs, 28/02/07
John, Smith, 26/02/07
Any idea's?
Thanks again,
Slash.
I'm trying to merge 3 files into one by doing the below:
Code: Select all
<?php
$fc=file("first.txt");
$fc1=file("second.txt");
$fc2=file("date.txt");
echo "$fc[0].$fc1[0].$fc2[0]<br>";
echo "$fc[1].$fc1[1].$fc2[1]<br>";
echo "$fc[2].$fc1[2].$fc2[2]<br>";
?>Joe, Bloggs, 28/02/07
John, Smith, 26/02/07
Any idea's?
Thanks again,
Slash.