I'm attempting to check for the existence of multiple files on a single website using the code below and am encountering a problem that only the top URL is being tested and even if it is a valid URL I still get URL doesn't exist
How would I modify the code to correctly return the results and check all the given url's within the text-file.
<?php
$site = "http://site.com"
$urls = file('urls.txt',FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$found = false;
foreach($urls as $url)
if($_POST['url'] == $site . $url)
$found = true;
if($found)
echo "URL exists";
else
echo 'URL doesn\'t exist';
?>