#!/usr/bin/php $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_VERBOSE => false )); curl_exec($ch); $http_status = curl_getinfo($ch); //print_r($http_status); if($http_status['http_code'] === 200 && in_array($http_status['content_type'], $content_type)) { return true; } else { return false; } } date_default_timezone_set('Europe/Berlin'); $day_our = 000; $i = 0; // Zähler $time_delay = time()-600; // 10 Minuten Toleranz $time_diff = 3600; // Stundenweise zurückgehen bis Bild vorhanden $content_type = array('image/jpeg','image/png'); do { // wenn kein aktuelles Bild vorhanden, dann zurübis zum letzten vorhandenen Bild (max. 150) $i++; $day_our = date("wH", $time_delay); $time_delay = $time_delay - $time_diff; } while (!check_img_url("http://webcam.stadt-geyer.de/loipe/loipe".$day_our.".jpg",$content_type) && $i < 150); ?>