I would like to check whether some files exist in some URLs. The two arrays here are independent. First I want to check the existence of each file from the $files array in url1. If file/files exist in url1, echo "found these files". If not, check the existence of files in url2 and so on.
If none of the files doesn't exist in any of the urls, echo "no file found".
I have written some codes to start with and now I need your help.
$urls = array('url1','url2','url3');
$files = array('file1','file2','file3');
foreach ($urls as $url) & foreach($files as $file)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if($retcode==200)
{
echo "found these files";
}else{
"no file found"
}
}