Re: testing the validity of a link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You could do an fopen on the URL and see if the results contain the string
"404 not found" or something.  Read these pages:

    http://www.php.net/manual/en/function.fopen.php
    http://www.php.net/manual/en/wrappers.php
    http://www.php.net/manual/en/function.stream-get-meta-data.php

Looks like with 4.3+ you can use the internal functions of PHP to do what
you are asking.

You could alternatively install curl and get the resulting HTTP code.

    http://www.php.net/manual/en/ref.curl.php

Peter



---------------------------------------------------------------------------
Peter Beckman                                                  Internet Guy
beckman@purplecow.com                             http://www.purplecow.com/
---------------------------------------------------------------------------

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux