public static function returnMatchingLinesFromFile($filePath, $textMatch) {
        $allLines = file($filePath);
        $matches = preg_grep("/" . $textMatch . "/i", $allLines);

        $cleanMatches = array_map(function ($str) {
            return str_replace(PHP_EOL, '', $str);
        }, $matches);

        return $cleanMatches;
    }
public static function returnMatchingLinesFromFile($filePath, $textMatch) {
        $allLines = file($filePath);
        $matches = preg_grep("/" . $textMatch . "/i", $allLines);

        $cleanMatches = array_map(function ($str) {
            return str_replace(PHP_EOL, '', $str);
        }, $matches);

        return $cleanMatches;
    }
public static function returnMatchingLinesFromFile ( $ filePath , $ textMatch ) { $ allLines = file ( $ filePath ) ; $ matches = preg_grep ( "/" . $ textMatch . "/i" , $ allLines ) ; $ cleanMatches = array_map ( function ( $ str ) { return str_replace ( PHP_EOL , '' , $ str ) ; } , $ matches ) ; return $ cleanMatches ; }
Return lines matching the text supplied.

@param $filePath
@param $textMatch
@return array
Return lines matching the text supplied .