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 388 views
2 answers 1,321 views
1 answer 266 views
3 answers 484 views
1 answer 288 views
2 answers 513 views
513 views asked May 24, 2014 by avibootz
1 answer 301 views
301 views asked Dec 16, 2015 by avibootz
...