PHP获取某年第几周德起始终止日期
防止以后忘掉,贴在这儿啦
function GetWeekDate($week,$year)
{
$timestamp = mktime(0,0,0,1,1,$year);
$dayofweek = date("w",$timestamp);
if( $week != 1)
$distance = ($week-1)*7-$dayofweek+1;
$passed_seconds = $distance * 86400;
$timestamp += $passed_seconds;
$firt_date_of_week = date("Ymd",$timestamp);
if($week == 1)
$distance = 7-$dayofweek;
else
$distance = 6;
$timestamp += $distance * 86400;
$last_date_of_week = date("Ymd",$timestamp);
return array($firt_date_of_week,$last_date_of_week);
}
相关文档:
1、使用GZip
在每一个PHP页面顶部加入以下代码:
<?php ob_start("ob_gzhandler");?>
使用该代码后服务器会压缩所有需要传送到客户端的代码,并在浏览器中进行解压,从而使网站运行速度加快。这一功能还可以节省网站空间的流量。
2、不要滥用Javascript和Ajax
只在需要的时候才使用Javascript和Ajax ......
<?php
/*
* Created on 2009-10-23
* 分子如梦o(╯□╰)o
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
class people
{
private $name;
pu ......
原文:http://www.phpx.com/tech/php/2009-01-29/286.html
下面是截取得apache返回客户端的头
---------
Last-Modified: Fri, 26 Jan 2007 01:53:34 GMT
& ......
PHP开发常见问题解决列表
1. 学习Zend Framework tutorial过程中的问题
(1)执行"zf create project zf-tutorial"出现如下错误:
'"php.exe"' is not recognized as an internal or external command, operable program or batch file.
解决办法:原因是因为php.ex ......
<?php
header("content-type:image/png"); //定义输出的图像类型;
$image=imagecreate(300,155); //新建图像;
$bg=imagecolorallocate($image,220,40,120); &nbs ......