
November 16th, 2009, 01:17 AM
|
 |
Stand
|
|
Join Date: Apr 2007
Location: Québec
Posts: 218
Time spent in forums: 3 Days 16 h 15 m 22 sec
Reputation Power: 3
|
|
php4 - Read file and modify line by line before echo ??
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!
__________________
That's why we are not alone on earth, to help each other !
Let's build !
|