{% else-1 %}
(19 июл 2015, 16:37) (1/0) [1]
$text = 'Привет';
$file = file_get_contents('text.txt');
if (preg_match("/$text/ui", $file)){
echo $text;
}



Если хочешь как-то выделить найденные слова

$text = 'Привет';
$file = file_get_contents('text.txt');
echo preg_replace("/$text/ui", "<strong>$text<strong>", $file);
  • 1 из 1