Home > php教程 > PHP源码 > 靠频繁刷新实现的图片数字时钟,很傻的方法,仅供娱乐。。。

靠频繁刷新实现的图片数字时钟,很傻的方法,仅供娱乐。。。

PHP中文网
Release: 2016-05-25 17:10:59
Original
1266 people have browsed it

php代码

<meta http-equiv="Refresh"content="1">

<?php
function clock(){

$hour=date("H");
$mitute=date("i");
$second=date("s");

$hour=str_split($hour);
$mitute=str_split($mitute);
$second=str_split($second);

foreach($hour as $h){
echo"<img src=&#39;img/".$h.".png&#39;>";
}

echo"<img src=&#39;img/fg.png&#39;>";

foreach($mitute as $m){
echo"<img src=&#39;img/".$m.".png&#39;>";
}

echo"<img src=&#39;img/fg.png&#39;>";

foreach($second as $s){
echo"<img src=&#39;img/".$s.".png&#39;>";
}
}
clock();
?>
Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template