public function doesFileExist($url) {
        // Setup connection
        $ch = curl_init($url);

        // We don't want to download the file, we just want to know if the file exists
        curl_setopt($ch, CURLOPT_NOBODY, true);

        // Execute cURL
        curl_exec($ch);

        // Get the HTTP status code
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

        // Close the connection
        curl_close($ch);

        // If status 200 the file exists, so return true in that case, otherwise false
        return $httpCode == 200;
    }
public function doesFileExist($url) {
        // Setup connection
        $ch = curl_init($url);

        // We don't want to download the file, we just want to know if the file exists
        curl_setopt($ch, CURLOPT_NOBODY, true);

        // Execute cURL
        curl_exec($ch);

        // Get the HTTP status code
        $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

        // Close the connection
        curl_close($ch);

        // If status 200 the file exists, so return true in that case, otherwise false
        return $httpCode == 200;
    }
public function doesFileExist ( $ url ) { // Setup connection $ ch = curl_init ( $ url ) ; // We don't want to download the file, we just want to know if the file exists curl_setopt ( $ ch , CURLOPT_NOBODY , true ) ; // Execute cURL curl_exec ( $ ch ) ; // Get the HTTP status code $ httpCode = curl_getinfo ( $ ch , CURLINFO_HTTP_CODE ) ; // Close the connection curl_close ( $ ch ) ; // If status 200 the file exists, so return true in that case, otherwise false return $ httpCode == 200 ; }
Checks if a file exists

@return bool
Checks if a file exists