getdate()関数取得可能情報一覧表(list, each)
<html>
<head>
<title>getdate()関数にて取得可能な情報一覧表</title>
</head>
<body>
<center>
<table border="1" bordercolor="#666699" cellspacing="0" cellpadding="5">
<caption>getdate()関数にて取得可能な情報一覧表</caption>
<th> </th><th>説明</th><th>現在の値</th>
<?php
$array = array( "seconds" => "秒", // 説明
"minutes" => "分",
"hours" => "時",
"mday" => "日",
"wday" => "曜日(0~6)",
"mon" => "月",
"year" => "年",
"yday" => "今年の1月1日からの日数",
"weekday" => "曜日(Sunday,Monday・・・)",
"month" => "月(January,February・・・)",
"0" => "1970年1月1日からの秒数");
$today = getdate(); // 日時を取得
while(list($key, $value) = each($today)) { // 取得した全ての値を表示
echo "<tr><td>$key</td><td>$array[$key] </td><td>$value</td></tr>\n";
}
?>
</table>
</center>
</body>
</html>
〔 実行する 〕