我用错了,用成date("w","2006-06-23");这样子了,所以出错,呵呵可是这只是判断某一天是星期几啊,还是没办法判断时间段中有几天是周末我的程序:
$str1=strtotime($str_time);
$str2=strtotime($of_time);$daycount=($str2-$str1)/(3600*24); for($i=1;$i<$daycount;$i++){
$every_day=date("Y-M-d",$str1+3600*24*$i);
if(date("w",strtotime($every_day)=='0' or date("w",strtotime($every_day)=='6')
$lasts="last[]";
}
$last_num=count($lasts);
这样写出错,帮我改改吧
$str1=strtotime($str_time);
$str2=strtotime($of_time);$daycount=($str2-$str1)/(3600*24); for($i=1;$i<$daycount;$i++){
$every_day=date("Y-M-d",$str1+3600*24*$i);
if(date("w",strtotime($every_day)=='0' or date("w",strtotime($every_day)=='6')
$lasts="last[]";
}
$last_num=count($lasts);
这样写出错,帮我改改吧
解决方案 »
- 谷歌的查询面页要怎么获取
- PHP网页跳转问题
- phpmyadmin2.10配置。
- 在您的php开发过程中,你用过的缓存技术是什么?
- js的变量对像处理
- php json 不能解析中文字符串???
- PHP根据不同URL 显示不同内容。
- 关于数据入库问题!
- 在家好,我怎么才能让我mysql的内容,按随机的id号输出呀?
- php奇怪的问题!php 提交后,如果有错误,history.back();,可是返回后,先前输入的东西都没有了,可能跟session有关,去掉了session就可
- 请大家帮帮忙,我用phpAdmin新建的数据库存在什么位置了.
- 有没有做在线考试系统的,能否提供一些经验.最好有实例!不胜感谢!
能不能详细点啊,不懂怎么做啊,谢谢了
$days = array("20060622","20060624","20060625");
foreach($days as $dayvalue)
{
$dayvalue = strtotime($dayvalue);
$day = date("D", $dayvalue);
if ( $day == "Sun" || $day == "Sat" )
{
array_push($cotainer, $dayvalue);
}
unset($day);
}
print_r($cotainer);