<!DOCTYPE html>
<html>
<head>
<title>判断是否为闰年</title>
<style type="text/css">
body{background:url(11.jpg) no-repeat;}
h2{text-align:center;}
p{
padding-left:15px;
}
.box{height:180px;width:535px;border:1px solid #eee;background-color:white;
opacity:0.8;}
</style>
</head>
<body>
<div class="box">
<?php
$year=2015;
if(($year%4==0)&&($year%100!=0)||($year%400==0)){
$result='是闰年';
}else{
$result='不是闰年';
}
$result=(($year%4==0)&&($year%100!=0)||($year%400==0))? '是闰年':'不是闰年' ;
echo '<h2>闰年的判断</h2>';
echo '<p>输入的年份:<input type="text" value=" '.$year.' ">';
echo '<p>判断的结果:'.$year.'年'.$result;
?>
</div>
</body>
</html>
今年是什么年?
最新推荐文章于 2024-06-12 11:59:04 发布