大佬教程收集整理的这篇文章主要介绍了php – Foreach循环只循环一次,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<?PHP $proxies = explode("\r\n",file_get_contents("proxies.txt")); foreach($proxies as $cpr0xy) { $aContext = array( 'http' => array( 'proxy' => "tcp://$cpr0xy",'request_fulluri' => true,'method'=>"GET",'header'=>"Accept-language: en\r\n" . "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/39.0.2171.95 Safari/537.36\r\n" ),); $rqcon = stream_context_create($aContext); $destc = file_get_contents("http://domain.com/file.PHP",false,$rqcon); echo $destc; } ?>
现在它只使用第一个代理并正确返回值,然后脚本停止.我的目标是让它无休止地发出请求,直到它在proxies.txt中的代理用完为止
以上是大佬教程为你收集整理的php – Foreach循环只循环一次全部内容,希望文章能够帮你解决php – Foreach循环只循环一次所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。