Here's one way to do this:
$mirrors = array("download1.exe","download2.exe","download3.exe");
foreach($mirrors as $mirror) {
$header_response = get_headers($mirror, 1);
if (strpos( $header_response[0], "404" ) === false) {
echo '<a href="', $mirror, '">Download from '.$mirror.'</a>';
break; //removing break will show all available mirrors
}
}