Hi I have a text file that looks like this:
"BranchID","PropertyID","PropertyName","Street","DisplayStreet","Postcode"
"PORT","ZL16J002","2 Jetty Court","Jetty Court","Y","E14 2SW"
I'm using the following PHP code to get the details out of the text file. If I write print $line[3] it will put the 3rd thing (eg, Propertyname) on all the lines in the text file onto the page. But Im having trouble putting lets say the address from line 2 on the page on its own.
<?php
$array = file("xfile2.txt");
foreach($array as $row) {
$line = explode('","', $row);
print "Name: $line[0], Email: $line[1], Email: $line[2], Email: $line[3], Email: $line[8]<br>";
}
print "$line[2]";
print "<br>";
print "$line[5]";
print "<br>";
print "$line[1]";
?>
Can anyone help?