Codice PHP:
function getRow($file_name$to_find) {
  
$file file($file_name);
  foreach(
$file as $line => $row) {
    if(
strpos($row$to_find) === true) return $line;
  }
  return -
1;

Onestamente non l'ho testato, ma dovrebbe andare.