How do you get the HTTP status code for a remote domain in php?

后端 未结 5 1310
不思量自难忘°
不思量自难忘° 2020-12-31 23:32

I would like to create a batch script, to go through 20,000 links in a DB, and weed out all the 404s and such. How would I get the HTTP status code for a remote url?

5条回答
  •  有刺的猬
    2021-01-01 00:08

    You can use PEAR's HTTP::head function.
    http://pear.php.net/manual/en/package.http.http.head.php

提交回复
热议问题