Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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';


Ïà¹ØÎĵµ£º

ÓÃPHPʵÏÖÒ»¸öË«Ïò¶ÓÁÐ

<?php
class DoubleQueue
{
public $queue = array();
/**£¨Î²²¿£©Èë¶Ó **/
public function push($value)
{
return array_push($this->queue,$value);
}
/**£¨Î²²¿£©³ö¶Ó**/
public function pop()
{
return array_pop($this->queu ......

web serverʹÓÃphpÉú³ÉwebÒ³ÃæµÄÈýÖÖ·½Ê½

²éÕÒmysql_pconnectʱÔÚmysql°ïÖúÎĵµÉÏ·¢Ïֵ쬼ÇÔÚÕâÀï¡£
web serverʹÓÃphpÉú³ÉÒ»¸öwebÒ³ÃæµÄÈýʽÓÐÒÔÏÂÈýÖÖ£º
Ò»£º°ÑPHP×÷ΪCGI Wrapper¡£ÕâÖÖ·½Ê½Ï£¬Ã¿¸öµ½´ïweb serverµÄÇëÇ󶼻ᵼÖÂÒ»¸öphp½âÎöÆ÷½ø³Ì±»´´½¨£¬µ±Õâ¸öphpÒ³ÃæÖ´ÐнáÊøÊ±£¬Õâ¸öphp½âÎöÆ÷½ø³ÌÖÕÖ¹¡£
¶þ£º
ÔÚ¶à½ø³ÌµÄweb serverÖУ¬°Ñphp×÷Ϊweb
se ......

json + js + php ¼òµ¥½»»¥

×î½üÔÚдһ¸ö ǰ̨»ùÓÚ javascript. µÄ¿Í»§¶Ë ·þÎñÆ÷¶ËPHP µÄ·ÖÎöϵͳ¡£
Ô­Ïȼƻ®Ê¹ÓÃXMLΪÊý¾Ý½»»¥»ù´¡ µ«ÊÇ×îÖÕ»¹ÊÇÑ¡ÓýÏÇáÁ¿¼¶µÄJSON×îΪÊý¾Ý½»»¥»ù´¡¡£
Ê×ÏȽéÉÜjsonµÄ¸ñʽ
json ˵¼òµ¥ÆäʵÊÇÒ»ÖÖÊý¾Ý¸ñʽ  ¸ü¼òµ¥µÄ¿ÉÒÔ¿´×ö¼òµ¥µÄÊý×é¡£
ʵÀý £¨Ò»£©
<script>
  var jsonArray=[
   ......

PHPÕýÔò±í´ïʽº¯Êý

ÕýÔò±í´ïʽ×Ô¼ºÒ»Ö±²»ÊìϤ£¬Õâ2ÌìÔÚÍøÉÏÒ»Ö±¿´¹ØÓÚËüµÄÎÄÕ£¬×Ô¼º×ܽáÁ˼¸¸öº¯Êý¡£
1£®preg_match()
º¯ÊýÔ­ÐÍ£ºint preg_match (string $pattern, string $content [, array
$matches])
preg_match
()º¯ÊýÔÚ$content×Ö·û´®ÖÐËÑË÷Óë$pattern¸ø³öµÄÕýÔò±í´ïʽÏàÆ¥ÅäµÄÄÚÈÝ¡£Èç¹ûÌṩÁË$matches£¬Ôò½«Æ¥Åä½á¹û·ÅÈëÆäÖС ......

php³õѧÕß

ÎÒÒ²ÊÇÒ»ASPתPHPµÄ³õѧÕߣ¬ÎÒÕâÀïÓÐÒ»ºÃµÄÍøÕ¾ÄÃÀ´Óë´ó¼ÒÒ»Æð·ÖÏí£¬Ï£Íû´ó¼Ò»áϲ»¶£¡
http://www.w3school.com.cn/
Ò²»¹ÓÐһЩºÃµÄÊÓÆµÒ²ÄÃÀ´Óë´ó¼ÒÒ»Æð·ÖÏí£¡
http://hi.baidu.com/ylinuxs/blog/item/4433d3354a58fed1a2cc2b26.html ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ