I think you'll have to read the file manually (file() would prob be the best bet) and manually find/delete the line and then rewrite the file.
Martin -----Original Message----- From: Matt Palermo [mailto:[EMAIL PROTECTED] Sent: Friday, June 06, 2003 1:54 PM To: [EMAIL PROTECTED] Subject: [PHP] delete lines from text file Can anyone help me figure out how to search for a string in a text file, then delete the whole line of text that it occurs in? For example: I have a text file which contains the following. //****** text.txt ****** Keep this line. Also keep this line. Delete this line. Keep this one too. Now I want to do a search on this text file for the word "delete" and if it finds that word, it will delete the whole line it occurs on. So after this, the text file will look like this one: //****** text.txt ****** Keep this line. Also keep this line. Keep this one too. Can anyone help me with this? Thanks. Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php