I\'m trying to search a PHP file for a string and when that string is found I want to return the whole LINE that the string is on. Here is my example code. I\'m thinking I
Here is an answered question about using regular expressions for your task.
Get line number from preg_match_all()
Searching a file and returning the specified line numbers.