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 271 views
2 answers 1,146 views
1 answer 177 views
3 answers 349 views
1 answer 202 views
2 answers 377 views
377 views asked May 24, 2014 by avibootz
1 answer 200 views
200 views asked Dec 16, 2015 by avibootz
...