- file_get_contents: documentation ( source)
- time: documentation ( source)
- preg_match_all: documentation ( source)
- date: documentation ( source)
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php
$url = "http://apt.saurik.com/debs/";
//ファイル取得
$file = file_get_contents($url);
$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 />";
}
if (!$data) {
return false;
}