Entry
How do I remove a single line from a multi-line text file?
Feb 24th, 2000 08:52
Matt Gregory, Todd Hammer, unknown unknown,
The easiest way to accomplish this is to simply read the entire text
file into an array using the file(string filename, int
[use_include_path) function (see php doccumentation). Once you have
the entire file in the array, write all the strings you wish to keep
back out over top of the old file. Yes, there are other ways to do
this which are slightly more efficient, but this is the fastest
implementation and takes the least code.