IF语句,多谢

WBOY
Release: 2016-06-13 10:25:55
Original
869 people have browsed it

求一个IF语句,谢谢。
求一个IF语句,$B与$D分别得不同的值

如果日期在这个期间
2012年4月9日至2012年7月7日
$b=array('b00.gif','b01.gif','b02.gif','b03.gif','b04.gif','b05.gif','b06.gif');
$d=array('d10.gif','d11.gif','d12.gif','d13.gif','d14.gif','d15.gif','d16.gif'); 
如果日期在这个期间
2012年7月8日至2012年10月6日
$b=array('b00.gif','b02.gif','b03.gif','b04.gif','b05.gif','b01.gif','b06.gif');
$d=array('d10.gif','d12.gif','d13.gif','d14.gif','d15.gif','d11.gif','d16.gif'); 
如果日期在这个期间
2012年10月7日至2013年1月5日
$b=array('b00.gif','b03.gif','b04.gif','b05.gif','b01.gif','b02.gif','b06.gif');
$d=array('d10.gif','d13.gif','d14.gif','d15.gif','d11.gif','d12.gif','d16.gif'); 

这个$a$c一直不变
$a=array('a00.gif','a01.gif','a02.gif','a03.gif','a04.gif','a05.gif','a06.gif'); 
$c=array('c10.gif','c11.gif','c12.gif','c13.gif','c14.gif','c15.gif','c16.gif');

------解决方案--------------------

PHP code
<?phpdate_default_timezone_set ("Asia/Hong_Kong");$date = "2012-08-20";switch($date){    case ($date > strtotime("2012-04-09") && $date  strtotime("2012-07-08") && $date  strtotime("2012-10-07") && $date <br><font color="#e78608">------解决方案--------------------</font><br>修改一下,<br>$date = strtotime("2012-08-20");<br>switch($date){……}<br><font color="#e78608">------解决方案--------------------</font><br>
Copy after login
探讨

引用:
修改一下,
$date = strtotime("2012-08-20");
switch($date){……}


$date = "2012-08-20"; 为什么是这个值呢?

------解决方案--------------------
PHP code
//给定的日期$geidingriqi='2012-04-10';$intime=strtotime($geidingriqi);if($intime>=strtotime('2012-04-09') and $intime<strtotime if>=strtotime('2012-07-08') and $intime<strtotime if>=strtotime('2012-10-7') and $intime<strtotime class="clear">
                 
              
              
        
            </strtotime></strtotime></strtotime>
Copy after login
Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!