Read file and modify line by line before echo ?? |
![]() ![]() |
Read file and modify line by line before echo ?? |
Nov 16 2009, 06:16 AM
Post
#1
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 8,266 Joined: 23-November 08 Member No.: 6,521 |
Good day to you all,
I'm working on a script wich permit me to read a file line by line and echo it. Here is my code now: PHP Code: <?php $console = $_GET["console"]; $name = $_GET["name"]; $file = fopen("info_gen.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { echo fgets($file). "<br />"; } fclose($file); ?> My problem is I need to be able to add or edit each and every line seperatly and differently before echo everyting. How can I do so ? Thanks! |
|
|
|
![]() ![]() ![]() |
|
Lo-Fi Version | Time is now: 15th March 2010 - 11:11 PM |