setlocale(LC_ALL, 'ru_RU.UTF-8'); header('Content-Type: text/html; charset=utf-8'); $out = file_get_contents("http://vseigru.net/igry-testy/19701-igra-gadalka-na-kazhdyj-den.html"); //echo $out; preg_match("/
Play(.*)<\/h1>/u", $out, $tit); var_dump($tit);
Displays NULL.
If you do the pattern preg_match("/(.*)<\/h1>/u", $out, $tit); , it displays all the rules, but with str_replace the same problem... the Website donor to utf-8
Find more questions by tags Character encodingPHPRegular expressions