phpÖÐʹÓÃheaderº¯ÊýµÄhttpÍ·ÉèÖÃ
/ ok
header('HTTP/1.1 200 OK');
//ÉèÖÃÒ»¸ö404Í·:
header('HTTP/1.1 404 Not Found');
//ÉèÖõØÖ·±»ÓÀ¾ÃµÄÖØ¶¨Ïò
header('HTTP/1.1 301 Moved Permanently');
//תµ½Ò»¸öеØÖ·
header('Location: http://www.example.org/'
);
//ÎļþÑÓ³ÙתÏò:
header('Refresh: 10; url=http://www.example.org/');
print 'You will be redirected in 10 seconds';
//µ±È»£¬Ò²¿ÉÒÔʹÓÃhtmlÓ﷨ʵÏÖ
// <meta http-equiv="refresh" content="10;http://www.example.org/ />
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
//ÎĵµÓïÑÔ
header('Content-language: en');
//¸æËßä¯ÀÀÆ÷×îºóÒ»´ÎÐÞ¸Äʱ¼ä
$time = time() - 60; // or filemtime($fn), etc
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
//¸æËßä¯ÀÀÆ÷ÎĵµÄÚÈÝûÓз¢Éú¸Ä±ä
header('HTTP/1.1 304 Not Modified');
//ÉèÖÃÄÚÈݳ¤¶È
header('Content-Length: 1234');
//ÉèÖÃΪһ¸öÏÂÔØÀàÐÍ
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="example.zip"');
header('Content-Transfer-Encoding: binary');
// load the file to send:
readfile('example.zip');
// ¶Ôµ±Ç°Îĵµ½ûÓûº´æ
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
//ÉèÖÃÄÚÈÝÀàÐÍ:
header('Content-Type: text/html; charset=iso-8859-1');
header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/plain'); //´¿Îı¾¸ñʽ
header('Content-Type: image/jpeg'); //JPG***
header('Content-Type: application/zip'); // ZIPÎļþ
header('Content-Type: application/pdf'); // PDFÎļþ
header('Content-Type: audio/mpeg'); // ÒôƵÎļþ
header('Content-Type: application/x-shockw**e-flash'); //Flash¶¯»
//ÏÔʾµÇ½¶Ô»°¿ò
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Top Secret"');
print 'Text that will be displayed if the user hits cancel or ';
print 'enters wrong login data';
Ïà¹ØÎĵµ£º
1.phpÊý×é»ù´¡£º
<?php
$ary2 = "zqhung_hongzequan_zqhong";
$arr3 =explode("_",$ary2);//²ð·Ö×Ö·û´®
echo $arr3[1];//´òÓ¡³öÀ´µÄ½á¹ûÊÇhongzequan
$ary1 = array("aa","bb");
$ary1[0]="zqhung";//ÐÞ¸ÄÊý×éÖеÄÖµ
echo $ary1[0],"<br>";//´òÓ¡³öÀ´µÄ½á¹ûÊÇzqhung
$ary3 = array("id"=>55);
......
°²×° Nginx
* Ò»ÌõÃüÁî¸ã¶¨£º
USE=fastcgi emerge nginx
* н¨Óû§ºÍ×飺
groupadd www
useradd www -g www
Nginx °²×°ºÃºóĬÈÏ»áÌí¼Ó nginx ×éºÍ nginx Óû§£¬²»¹ýÎÒ±¾Éí»¹ÊÇϰ¹ßн¨¸ö www ×éºÍ www Óû§À´×ö HTTP ·þÎñÓû§¡£Èô½ñºó HTTP ·þÎñÆ÷¸ü»»Îª apache »òÊÇ lighttpd ʱ£¬Óû§ÃûºÍÓû§×é¿ÉÒÔ²»±ä¡£
°²×° M ......
ÕýÔò±í´ïʽ×Ô¼ºÒ»Ö±²»ÊìϤ£¬Õâ2ÌìÔÚÍøÉÏÒ»Ö±¿´¹ØÓÚËüµÄÎÄÕ£¬×Ô¼º×ܽáÁ˼¸¸öº¯Êý¡£
1£®preg_match()
º¯ÊýÔÐÍ£ºint preg_match (string $pattern, string $content [, array
$matches])
preg_match
()º¯ÊýÔÚ$content×Ö·û´®ÖÐËÑË÷Óë$pattern¸ø³öµÄÕýÔò±í´ïʽÏàÆ¥ÅäµÄÄÚÈÝ¡£Èç¹ûÌṩÁË$matches£¬Ôò½«Æ¥Åä½á¹û·ÅÈëÆäÖС ......
<?php
function delfile($dir,$n) //ɾ³ýDIR·¾¶ÏÂNÌìǰ´´½¨µÄËùÓÐÎļþ;
{
if(is_dir($dir))
{
if($dh=opendir($dir))
{
while (false !== ($file = readdir($dh)))
{
if($file!="." && $file!="..")
{
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)) ......