ページにアクセスした時間の秒が
00だった場合は「ジャストタイム!!」
00を除くゾロ目だった場合は「ゾロ目!」
上記以外の場合は「外れ」
という文字と秒を表示するプログラムを作成
<?php
$second = date("s");
?>
<!doctype html>
<html lang="ja">
<head>
<meta charset='utf-8'>
<title>訪問時刻でif</title>
</head>
<body>
<h1><?php echo date("Y/m/d H:i:s"); ?></h1>
<?php if($second === "00"){?>
<h2>ジャストタイム!!</h2>
<p>アクセスした瞬間の秒は00秒でした!!</p>
<?php } else if ($second === "11" || $second === "22" ||$second === "33"
|| $second === "44" || $second === "55"){ ?>
<h2>ゾロ目!</h2>
<p>アクセスした瞬間の秒はゾロ目でした!</p>
<?php } else { ?>
<h2>外れ</h2>
<p>アクセスした瞬間の秒は<?php print $second; ?></p>
s<?php } ?>
</body>
</html>
ゾロ目の判定は他にやり方ないものですかね…