i have been looking for how to do this and just can find how to. I am a newbie so sry if it sounds dumb. i have a program that generates a file that is separated by ";" and it has about 15 lines. well i need to to display the everything before the first ";" for every line.
for example the file looks like this:
Wichita runway 01L/19R;37.6350231000;-97.4459919000;1312;70.0089000000;Aircraft at runway 01L survey point (GPSX = 0.0 feet)
Wichita runway 14/32;37.6575503000;-97.4400708000;1332;-59.9989198000;Aircraft at runway 14 survey point (GPSX = 0.0 feet)
Wichita runway 01R/19L;37.6427669000;-97.4262814000;1320;69.9949227600;Aircraft at runway 01R survey point (GPSX = 0.0 feet)
and i need to display the parts before each ";" on each line and i just cant. i am using the following code:
<?
$row = 1;
$fp = fopen ("air.cfg","r");
while ($data = fgetcsv ($fp, 1000000, ";"))
{
$num = count ($data);
echo ("<br>");
$row++;
for ($c=0; $c<$num; $c++)
{
print $data[$c] . "<br>";
}
}
fclose ($fp);
?>
but it lists everything in the file. please help!!!
-MBisME