Jmacp
Apr 18th, 2007, 02:52 AM
I have a txt file thats storing data, so each new line will look like,
aaa||bbb||ccc
sss||ttt||rrr
etc..
any idea the best way to split each line one by one on the "||" then display those entries row by row, something like,
guestbook table,
name email comment
aaa bbb ccc
sss ttt rrr
Have been trying for ages, playing about with,
$file = fopen("guestbook.txt", "r");
while(!feof($file))
{
$wr= fgets($file);
$s=explode("||",$wr);
for($i=0;$i<sizeof($s);$i++){
.....
kinda things....
aaa||bbb||ccc
sss||ttt||rrr
etc..
any idea the best way to split each line one by one on the "||" then display those entries row by row, something like,
guestbook table,
name email comment
aaa bbb ccc
sss ttt rrr
Have been trying for ages, playing about with,
$file = fopen("guestbook.txt", "r");
while(!feof($file))
{
$wr= fgets($file);
$s=explode("||",$wr);
for($i=0;$i<sizeof($s);$i++){
.....
kinda things....