Menu
hi i have the following saved in a fle called “name.txt”.
Mark, 20, Y
James, 21, X
Al, 30, W
I want to make php print the file in the browser in a format like this:
Mark
20
Y
James
21
x
Al
30
W
how do i do this????
this is my php code below please tell me what am i doing wrong:
<?
$namefile = (“name.txt”);
$filepointer = fopen($namefile,”r”);
$myarray = file($namefile);
for ($i=0; $i< count($myarray); $i++)
{
$aline = $myarray[$i];
print $aline . “n”;
}
fclose ($filepointer);
function splitsubroutine($aline, $col)
{
$intoarray = explode(“,”,$aline);
return $intoarray[$i];
}
?>