If the txt file is a CSV (comma-separated values) with one record per line, then you could do the following:
1) Open the file using fopen().
2) Cycle through all the entries using a while loop
3) On each round, if the line is not the entry you are looking for, add it to an array, $file_array, say. (If it is the line you're looking for, do nothing). You could use a preg function to check.
4) Once the loop is finished, close the file using fclose().
5) Save the contents of $file_array back to the same txt file.
This all depends on the structure of your txt file, though.
(You could use the file() function to open the file in one swoop directly into an array and loop through that instead. This could have 'efficiency' problems if the file is large, though.)