Hi, I'm trying to figure out how to do this right:
I have this text file:
date 1 | head 1 | text 1
date 2 | head 2 | text 2
date 3 | head 3 | text 3
And I want to display in a HTML-page like this:
date 1
head 1
text 1
date 2
head 2
text 2
date 3
head 3
text 3
And I'm trying to do it with follwing code:
//sniped
39> while (list ($line_num, $line) = each ($contentlines))
40> {
41> $message = explode ("|", $line);
42>
43> while (list ($date, $head, $text) = each($message))
44> {
45> echo "$date, $head, $text<br>";
46> };
47> };
//sniped
But I get this result:
Warning: Undefined offset: 2 in c:\inetpub\wwwroot\read_txt_0007.php on
line 43
0, date 1,
Warning: Undefined offset: 2 in c:\inetpub\wwwroot\read_txt_0007.php on
line 43
1, head 1,
Warning: Undefined offset: 2 in c:\inetpub\wwwroot\read_txt_0007.php on
line 43
2, text 1,
Warning: Undefined offset: 2 in c:\inetpub\wwwroot\read_txt_0007.php on
line 43
0, date 2,
etc.
Can anyone point me to a solution for this?
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: [EMAIL PROTECTED]
Homepage: www.sed.is <- New Homepage!
------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]