随笔分类 -  php

摘要:一、数据类型integer ex:$intName1 = 12;double ex:$a=100.0235;boolean ex:$boolName1 = false;string ex:$tringName1 = "hello";二、集合array ex:$array = array(1,2,3);object ex:$a = new A();三、流程if ex:<?php$foo = "xxx";if($foo == "xxx"){ echo "==";}else{ echo "!=" 阅读全文
posted @ 2012-02-10 21:33 木由水 阅读(195) 评论(0) 推荐(0)
摘要:$date1 = strtotime('2011-04-30'); //把日期转换成时间戳$date2 = time(); //取当前时间的时间戳 $nowtime=strftime("%y年-%m月-%d日 ",$date2); //格式化输出日期 $days=round(($date1-$date2)/3600/24); //四舍五入 echo "今天是<font color=\"red\">".$nowtime."</font>";echo "<br/& 阅读全文
posted @ 2011-04-26 13:34 木由水 阅读(1377) 评论(0) 推荐(0)