I have a file that looks something like this.
Kate
Johnny
Bill
Kermit
I want to be able to put, for example, "Bill" into a string, and remove "Bill", or whatever is in the variable, and the subsequent "\r\n" from the file. The variable will always contain something that is already in the file, there won't be "George" if there is no George.
This code checks if "Bill" is in file.
$fileContents = file_get_contents("names.txt");
if(strpos($fileContents, "Bill"))
{
//Bill is here!
}
How would I expand upon this to remove "Bill\r\n"? Thanks in advance!
Bill
. – Andrey Oct 04 '12 at 03:16