3v4l.org

run code in 300+ PHP versions simultaneously
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <?php $url = "http://apt.saurik.com/debs/"; $opt = array("http" => array('ignore_errors' => true)); $options = array( 'http' => array( 'method' => 'GET', 'header' => 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25', ), ); $context = stream_context_create($options); //ファイル取得 $file = file_get_contents($url, false, $context); $namepat = '/<a.*?<\/a>".*?"/'; preg_match_all($namepat, $file, $data, PREG_SET_ORDER); //日付を先に取得 $date = time(); $dates = date("Y/m/d H:i:s",$date); //echo date("Y/m/d H:i:s",$date); foreach ($data as $name) { echo $name[0]."<br />"; }

preferences:
33.36 ms | 402 KiB | 5 Q