Hello Deconstructing with the help of curls in the url array array:
function curl($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, " Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36"); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 400); $output = curl_exec($ch); if(output === false) { echo 'Ошибка curl: ' . curl_error($ch) . 'Код curl: ' . curl_errno($ch); } curl_close($ch); return $output; } foreach ($urls as url){ $result = curl($url); } But in some cases, when the result is displayed, everything goes well, but most of them return Ошибка curl: malformed Код curl: 3 , although the links are working and displayed correctly in the browser. Put sleep() to slow down the execution of the script - it does not help. What could be the problem? Thank.
curl_execoccurs? - teranoutputinstead of$outputinife place is written - teran