reading a .txt-file with php

This is a discussion on reading a .txt-file with php within the PHP Language forums, part of the PHP Programming Forums category; Hello NG, I have the following problem and it would be nice, if someone could help me out on this ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-09-2003
Jules Bach
 
Posts: n/a
Default reading a .txt-file with php

Hello NG,

I have the following problem and it would be nice, if someone could help
me out on this problem:

Thanks for your help!
Jules Bach



content of file.txt

#1: Michael
#2: Dennis
#3: Karl


the following file writes only the first line of file.txt:

<?php
$fp = fopen("file.txt","r");
if ($fp)
{
$line = fgets($fp, 100);
echo "$line<br><br>";
fclose($fp);
}
?>

Now I would like to have a PHP-file, which can write every line in
different orders (the order should be write in the PHP-file)

for example:

#2: Dennis
#1: Michael
#3: Karl

is this possible? Thank you very much for your help.

Reply With Quote
  #2 (permalink)  
Old 09-09-2003
 
Posts: n/a
Default Re: reading a .txt-file with php

"Jules Bach" <jules.bach@gmx.de> wrote in message
news:bjkvc1$3p9$1@online.de...
> Hello NG,
>
> I have the following problem and it would be nice, if someone could help
> me out on this problem:
>

<snip>

Already answered in alt.php. Please don't multipost.
http://oakroadsystems.com/genl/unice.htm#xpost


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:12 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0