You are here: Re: checking for broken URLs with PHP? « PHP Programming Language « IT news, forums, messages
Re: checking for broken URLs with PHP?

Posted by AK on 11/14/07 12:46

On Nov 14, 12:09 am, Csaba Gabor <dans...@gmail.com> wrote:
> On Nov 13, 12:00 pm, AK <danr...@gmail.com> wrote:
> ...
>
> > Can anyone tell me how to connect to a URL using PHP for the purpose
> > of obtaining the HTTP response code? Specifically, I want to be able
> > to ascertain whether a link is down (404) or alive.
>
> > A bare-bones example would be appreciated.
>
> <?php
> file_get_contents("http://google.com");
> var_dump($http_response_header);
> ?>
>
> Csaba Gabor from Vienna

Thanks, that's the sort of "quick solution" I was looking for
(although I managed to find it myself after a bit of digging:
$arr = get_headers("http://www.google.com");
is even more concise)

Thanks to the previous responses as well, including the one that
suggested using a quaint little thing that seems to have the amazing
ability to search through web pages! (Google, I think it's called... )

Cheers

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация