Yes there is.
Get a list of URLs.
Take each URL and perform an fopen() on it.
This will either return an error or a filepointer.
If it returns an error, there is most likely a problem with the URL itself (lookup the server in the dns etc)
If it returns a filepointer, read the first line of that file
and close the file.
The first line always contains a server-status message, like
http:1.1 200 ok
http:1.0 404 not found
use regexp or whatever else to get the status code out of this line and you're done.