php计算日期差天数
<?PHP
//今天与2004年10月27日相差多少天
$Date_1=date("Y-m-d");
$Date_2="2004-10-27";
$d1=strtotime($Date_1);
$d2=strtotime($Date_2);
$Days=round(($d1-$d2)/3600/24);
Echo "今天与2004年10月27日相差".$Days."天";
Echo "<br>";
//今天到2008年9月9日还有多少天
$Date_1=date("Y-m-d");
$Date_2="2008-09-09";
$d1=strtotime($Date_1);
$d2=strtotime($Date_2);
$Days=round(($d2-$d1)/3600/24);
Echo "今天到2008年9月9日还有".$Days."天";
?>
//---------------------------------------------
$arrayStartDate =explode("/",$myStartDate);
$arrayEndDate = explode("/",$myEndDate);
$jdStartDate = cal_to_jd(CAL_GREGORIAN,$arrayStartDate[1],$arrayStartDate[0],$arrayStartDate[2]);
$jdEndDate = cal_to_jd(CAL_GREGORIAN,$arrayEndDate[1],$arrayEndDate[0],$arrayEndDate[2]);
$duration = $jdEndDate - $jdStartDate + 1;
统计几天以后到期的数据
datediff(yxdate_star,now())
返回 天数 = yxdate_star-now()
相关文档:
今天废了一天的时间来从新把环境搭建好:做个笔记
安装顺序:
apache->php->mysql
一些注意的地方记下来吧:
1. apache 支持 php
apache 配置文件下:需要修改的地方:
i. PHPIniDir "F:/programs/php/"
&n ......
关于 PHP 教程的文章已经很多了,今天给大家介绍几个常用的MYSQL语句。
显示数据库或表:
show databases;//然后可以use database_name;
show tables;
更改表名:
alter table table_name rename new_t;
添加列 :
alter table table_name add column c_n column attributes;
删除列:
alter table table_name ......
<?php
$txt = 'Hello world';
echo $txt;
?>
<br/>
字符串连接(.)
<br/>
echo 'Hello world'. "" . '1234' 输出:
<?php
$txt1 = 'Hello world';
$txt2 = '1234';
  ......
所需软件(注意版本!):
Apache2.2.3
PHP5.1.5
MySQL5.0.24
这三个软件都是免费的,可从官网上下载,目前我所有的软件名为:
apache_2.2.3-win32-x86-no_ssl.msi
mysql-5.0.24-win32.zip
php-5.1.5-Win32.zip
基于windows操作系统,在Windows XP下安装使用:
1、安装过程:  ......