<?php
if(isSet($_GET["urls"]) && $_GET["urls"] != ""){
  $urls = explode("\n", $_GET["urls"]);
  $good = Array();
  $bad =  Array();
  foreach($urls as $url){
    if($id = @fopen(trim($url), 'r')){
      $good[] = $url;
      fclose($id);
    }
    else{
      $bad[] = $url;
    }
  }
  echo "<b>Adresy poprawne</b>:<br>";
  foreach($good as $url){
    echo $url . "<br>";
  }
  echo "<b>Adresy niepoprawne</b>:<br>";
  foreach($bad as $url){
    echo $url . "<br>";
  }
}
else{
  echo "Proszę podać adresy do sprawdzenia.";
}
?>
