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

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

PHP中文网
PHP中文网Original
2016-05-25 17:10:591197browse

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();
?>
Statement:
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