How to check if remote file in specific URL exists with PHP

1 Answer

0 votes
$remote_file = 'https://www.collectivesolver.com//files/source_code.zip';

$handle = @fopen($remote_file, 'r');

if (!$handle){
    echo 'File not found';
} else {
    echo 'File exist';
}



/*
run:
           
File not found
 
*/

 



answered Sep 22, 2019 by avibootz

Related questions

1 answer 274 views
2 answers 1,150 views
1 answer 178 views
3 answers 351 views
1 answer 205 views
2 answers 381 views
381 views asked May 24, 2014 by avibootz
1 answer 204 views
204 views asked Dec 16, 2015 by avibootz
...