editing files
Posted: Thu Aug 19, 2004 2:48 pm
hey guys, I'm a little messed up with reading/writing files. How would you acomplish the task the replace a special line in a given file where the line is something like $name = "bla"; and has to be replaced with another name?
Surely I could read the entire file into a variable use str_replace and then write the whole file back but isn't there a more elegant way??? (i.e. reading line by line and editing just the current line?)
Surely I could read the entire file into a variable use str_replace and then write the whole file back but isn't there a more elegant way??? (i.e. reading line by line and editing just the current line?)