Home >php教程 >PHP源码 >显示周一到周日

显示周一到周日

WBOY
WBOYOriginal
2016-06-02 09:14:181634browse
跳至 [1] [全屏预览]
                        <ul>
                            <?php
                            $time = time();
                            $week = date('w');
                            $week_cn=array('周日','周一','周二','周三','周四','周五','周六');
                            for($i=0;$i<7;$i++){
                                $day = $time+$i*86400;
                                ?>
                                <li <?php if($i==0){?>class="current"<?php }?> date="<?php echo date('Y-m-d',$day)?>">
                                    <span><?php echo $week_cn[($week+$i)%7]?></span>
                                    <?php echo date('m-d',$day)?>
                                </li>
                            <?php }?>
                        </ul>

2. [图片] QQ截图20160526145044.png    

显示周一到周日
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