sushil bharwani
sushil bharwani

Reputation: 30197

php url_exists function for https urls

function url_exists($url) {
        $return = false;
        $content=@file_get_contents($url, FALSE, NULL, 0, 20);
        if($content == false ) {
            $return = false;
        } else if (count($content) 

How to modify this function to check on content on https URLS as well. This is currently not able to check existense of file there.

Upvotes: 0

Views: 301

Answers (2)

rik
rik

Reputation: 8622

Remove the silence operator @ and see what error you get.

Upvotes: 1

acme
acme

Reputation: 14856

Have you tried PHPs file_exists() that supports URLs, too?

Upvotes: 0

Related Questions