file_get_contents () не работает для 2 URL

я использую file_get_contents() функция, чтобы получить две веб-страницы от Google. Мой код:

var_dump(htmlspecialchars(html_entity_decode(file_get_contents('https://www.google.com/search?q=moscow+russia&start=30'))));

var_dump(htmlspecialchars(html_entity_decode(file_get_contents('https://www.google.com/search?q=ice&start=00'))));

file_get_contents Функция работает для первого URL, но не работает для второго URL. В чем проблема?

0

Решение

Это потому, что есть персонаж, который не может быть обработан htmlspecialchars, file_get_contents работает.

Пытаться ENT_SUBSTITUTE опция:

var_dump(htmlspecialchars(html_entity_decode(file_get_contents('https://www.google.com/search?q=moscow+russia&start=30'))));

https://secure.php.net/manual/en/function.htmlspecialchars.php

0

Другие решения

Других решений пока нет …

По вопросам рекламы ammmcru@yandex.ru
Adblock
detector