<? $s='bla'; $fil=file_get_contents('1.txt'); $fil=str_replace("\r\n","",$fil); $k=preg_match_all("/$s/i",$fil,$serch); echo $k; ?>