龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php 我自己在用的php日期抓取

时间:2014-07-28 11:07来源:网络整理 作者:网络 点击:
分享到:
我自己在用的php日期抓取 [代码片段(22行)]
<?php

echo j7_getdate('Y-m-d','2010-11-15','+10 day');

function j7_getdate($format,$time='now',$opt){
  return date("$format",strtotime("$time $opt"));
}

//輸出 2010-11-25
//詳細 strtotime 使用方法
/*
echo strtotime("now"), "\\n";
echo strtotime("10 September 2000"), "\\n";
echo strtotime("+1 day"), "\\n";
echo strtotime("+1 week"), "\\n";
echo strtotime("+1 week 2 days 4 hours 2 seconds"), "\\n";
echo strtotime("next Thursday"), "\\n";
echo strtotime("last Monday"), "\\n";
*/

?>
//该片段来自于http://outofmemory.cn
精彩图集

赞助商链接