fork download
  1. <?php
  2.  
  3.  
  4. foreach ($key as $k => $line){
  5. $eachLine = explode("|", $line); // тут у нас разделитель столбцов это |
  6. $titleColumn = $eachLine[1]; // а здесь я ищу по второму столбцу значение
  7.  
  8. if (strpos($titleColumn, $find) == true) { // если есть совпадение - выводим
  9. echo "FOUND:"."\t". $k . "\t".$line."\r\n";
  10. }
  11.  
  12. }
  13.  
  14.  
  15. // your code goes here
Success #stdin #stdout #stderr 0s 82560KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
PHP Notice:  Undefined variable: key in /home/Y6vCnu/prog.php on line 4
PHP Warning:  Invalid argument supplied for foreach() in /home/Y6vCnu/prog.php on line 4