Answer the question
In order to leave comments, you need to log in
Preg_match does not work with Cyrillic in the template.. Why?
Hello, friends. The second day I'm scratching my head, why doesn't preg_match work?
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("/<h1>Игра(.*)<\/h1>/u", $out, $tit);
var_dump($tit);
Answer the question
In order to leave comments, you need to log in
Works for me. Under var_dump($tit) do var_dump(preg_last_error());
Show me what it outputs.
What is the encoding of the script?
Is the script file exactly in UTF-8 encoding?
The PSR-1 standard requires: Files MUST use only UTF-8 without BOM for PHP code .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question