如何获取一个ip地址的HTTP状态码?

bluefan117 2008-04-25 01:48:35
如题。
比如一个url='www.google.com',php中如何获取其的HTTP状态码,200表示正常,404表示不存在。
...全文
228 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
sunfan1010 2008-04-25
  • 打赏
  • 举报
回复
I don't think its possible, just had a look around the HTTP and Apache functions in the PHP manual and can't find anything. only can get the HTTP status code of the current page in PHP with $_SERVER['REDIRECT_STATUS'] .so you can use fopen("http://www.example.com/", "r");
laruence 2008-04-25
  • 打赏
  • 举报
回复
curl
fopen
`wget`
fsockopen

=====
fxs_2008 2008-04-25
  • 打赏
  • 举报
回复
用ajax
或xmlhttp

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧