Answers for "php check if file exists on another server bash"

PHP
0

php check if image exists on remote server

function remote_file_exists($url)
{
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_NOBODY, true);
    curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if( $httpCode == 200 ){return true;}
}

//THE USE THE BELOW FUNCTION CALL

if(remote_file_exists($url))
{
    //file exists, do something
}
Posted by: Guest on August-07-2020
5

php check if file exists

if (!file_exists('http://mysite.com/images/thumbnail_1286954822.jpg')) {   
$filefound = '0';                         
}
Posted by: Guest on March-24-2020

Code answers related to "php check if file exists on another server bash"

Browse Popular Code Answers by Language