| Senior Member Name: Bobby Eubank Join Date: Jun 2005
Posts: 1,177
NP$: 770.25 ( Donate)
| I needed this a little while ago, and here is what I have: PHP Code: function url_exists($url) {
@ $headers = get_headers($url);
return preg_match('/^HTTP\/\d\.\d\s+(200|301|302)/', $headers[0]);
}
then use:
if ($headers[0] == 1) {
code
}
__________________
Proud owner of: LLLL.com/.org./net's, L-L-L.com's, L--L.com's, LL-L.com's, L-LL.com's, NNNN.com/.org/.net's, NNNNN.com/.net's, NN-N.com's, N-NN.com's, LLL.biz's, and other combinations My Sedo Names |