Добавлен для пробы curl-helper.php, работоющий с библиотекой cURL

This commit is contained in:
2024-08-26 17:20:55 +03:00
parent 30733f294c
commit 04406fb444
3 changed files with 103 additions and 3 deletions

View File

@ -29,11 +29,12 @@ class ContingentParser
$dom = new \DOMDocument(
// encoding: "UTF-8"
);
if (mb_detect_encoding($html, 'UTF-8, windows-1251') != "UTF-8") {
$encoding = mb_detect_encoding($html, 'UTF-8, windows-1251');
if ($encoding != "UTF-8") {
$html = mb_convert_encoding(
$html,
'UTF-8',
mb_detect_encoding($html, 'UTF-8, windows-1251')
$encoding
);
$html = str_replace('windows-1251','utf-8', $html);
} else {