0
A
回答
0
使用curl,你可以做到这一点...尝试以下之一:
<?php
$proxy = "xx.xx.xx.xx:xx";
$proxy = explode(':', $proxy);
$url = "http://www.google.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy[0]);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy[1]);
curl_setopt($ch, CURLOPT_HEADER, 1);
$exec = curl_exec($ch);
?>
+0
感谢您的回复。我不明白如何使用它。你能解释一下吗?在'$ proxy'中,我把我的代理IP地址,然后我运行脚本。要检查IP地址,我把'$ _SERVER ['SERVER_ADDR']'它显示我的IP而不是代理。 – Gowri 2014-11-25 06:32:05
相关问题
- 1. http php代理服务器
- 2. PHP IP代理服务器
- 3. PHP HTTP代理服务器
- 4. 在初始化/代理服务器/代理服务器/
- 5. 获取一个php代理服务器?
- 6. PHP源代码管理服务器
- 7. php代理到本地mercurial服务器
- 8. PHP代理服务器和调用JSON?
- 9. 使用PHP检查代理服务器
- 10. 通过“代理”服务器PHP刷新服务器响应
- 11. 通过服务器/代理服务器
- 12. PHP cURL无法在活动服务器上使用代理服务器
- 13. Web服务和代理服务器
- 14. 设置代理服务器
- 15. Netty代理服务器
- 16. HTTP代理服务器
- 17. ServiceStack HttpUtils +代理服务器
- 18. 通过代理服务器
- 19. TidUDPClient通代理服务器
- 20. R过代理服务器
- 21. C linux代理服务器
- 22. 代理服务器启用
- 23. 写代理服务器
- 24. cURL代理服务器
- 25. omniauth代理服务器
- 26. 实现代理服务器
- 27. 代理服务器org.springframework.orm.jpa.SharedEntityManagerCreator:invoke:289
- 28. 像SQUID代理服务器
- 29. 家庭代理服务器
- 30. 创建代理服务器
请检查此链接:http://stackoverflow.com/questions/8271921/change-ip-address-of-server -using-php – 2014-11-25 06:14:58