Entry
How do I use PHP to "print" data on an HTML page from a comma delimited text file?
Aug 19th, 2002 09:33
Lee Forkenbrock, K L, php.net
This is probably the easiest way, using the explode function.
Explode takes a string and splits it into an array based on a
given delimeter, in your case a ",".
$fp = fopen("file", "r");
while(!feof($fp)) {
$string = fgets($fp);
$array_str = explode(",", "$array_str"); //explode line
for($i=0; $i<count($array_str); $i++) //go through each new string
{
echo $array_str[$i]; //format as you wish
echo "<br>"
}
}
fclose($fp);
That should do it, I hope I didn't leave anything out...Good Luck