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';
Ïà¹ØÎĵµ£º
NGINX°²×°ÊÖ¼Ç
Ò»¡¢»·¾³ÐèÒªºÍÏÂÔØ
1. ÀûÓÃYUM°²×°±ØÐëµÄ³ÌÐò¿â
# yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-dev ......
ÕýÔò±í´ïʽ×Ô¼ºÒ»Ö±²»ÊìϤ£¬Õâ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)) ......
±¾ÎÄÌṩÁË20¸ö·Ç³£ÓÐÓõÄPHPÀà¿âµÄÃû³ÆºÍÏÂÔØµØÖ·¡£Õâ20¸öPHPÀà¿â°üº¬ÁËͼ±ê¿â£¬RSS½âÎö£¬ËõÂÔͼÉú³É£¬Ö§¸¶£¬OpenID£¬Êý¾Ý¿â³é Ïó£¬PDFÉú³ÉÆ÷µÈһϵÁй¦ÄÜ¡£
ÏÂÃæÊÇһЩ·Ç³£ÓÐÓõÄPHPÀà¿â£¬ÏàÐÅÒ»¶¨¿ÉÒÔΪÄãµÄWEB¿ª·¢Ìṩ¸üºÃºÍ¸üΪ¿ìËٵķ½·¨¡£
ͼ±í¿â
ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµÄ´´½¨¸´ÔÓµÄͼ±íºÍͼƬ¡£µ±È»£¬ËüÃÇÐèÒªG ......