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

·ÖÎöPHPµÄob_start()


ÔÚPHP±à³ÌÖÐ, ÎÒÃǾ­³£»áÓöµ½Ò»Ð©Ö±½Ó²úÉúÊä³öµÄº¯Êý, Èçpassthru(),readfile(), var_dump() µÈ. µ«ÓÐʱÎÒÃÇÏë°ÑÕâЩº¯ÊýµÄÊä³öµ¼Èëµ½ÎļþÖÐ,»òÕßÏȾ­¹ý´¦ÀíÔÙÊä³ö, »òÕß°ÑÕâЩº¯ÊýµÄÊä³ö×÷Ϊ×Ö·û´®À´´¦Àí.
¡¡¡¡ÕâʱÎÒÃǾÍÒªÓõ½ Output Buffer(Êä³ö»º³å) º¯ÊýÁË.
´¦ÀíÊä³ö»º³åµÄº¯ÊýÖ÷ÒªÓÐÕâô¼¸¸ö:
ob_start() ¿ªÊ¼Êä³ö»º³å, ÕâʱPHPÍ£Ö¹Êä³ö, ÔÚÕâÒÔºóµÄÊä³ö¶¼±»×ªµ½Ò»¸öÄÚ²¿µÄ»º³åÀï.
ob_get_contents() Õâ¸öº¯Êý·µ»ØÄÚ²¿»º³åµÄÄÚÈÝ. Õâ¾ÍµÈÓÚ°ÑÕâЩÊä³ö¶¼±ä³ÉÁË×Ö·û´®.
ob_get_ length() ·µ»ØÄÚ²¿»º³åµÄ³¤¶È.
ob_end_flush() ½áÊøÊä³ö»º³å, ²¢Êä³ö»º³åÀïµÄÄÚÈÝ. ÔÚÕâÒÔºóµÄÊä³ö¶¼ÊÇÕý³£Êä³ö.
ob_end_clean() ½áÊøÊä³ö»º³å, ²¢ÈÓµô»º³åÀïµÄÄÚÈÝ.
¡¡¡¡¾Ù¸öÀý×Ó, var_dump()º¯ÊýÊä³öÒ»¸ö±äÁ¿µÄ½á¹¹ºÍÄÚÈÝ, ÕâÔÚµ÷ÊÔµÄʱºòºÜÓÐÓÃ.
µ«Èç¹û±äÁ¿µÄÄÚÈÝÀïÓÐ < , > µÈHTMLµÄÌØÊâ×Ö·û, Êä³öµ½ÍøÒ³Àï¾Í¿´²»¼ûÁË. Ôõô°ìÄØ?
ÓÃÊä³ö»º³åº¯ÊýÄܺÜÈÝÒ׵Ľâ¾öÕâ¸öÎÊÌâ.
ob_start();
var_dump($var);
$out = ob_get_contents();
ob_end_clean();
Õâʱvar_dump()µÄÊä³öÒѾ­´æÔÚ $out ÀïÁË. Äã¿ÉÒÔÏÖÔÚ¾ÍÊä³ö:
echo ''<pre>'' . htmlspecialchars($out) . ''</pre>'' ;
»òÕߵȵ½½«À´, ÔÙ»òÕß°ÑÕâ¸ö×Ö·û´®Ë͵½Ä£°å(Template)ÀïÔÙÊä³ö


Ïà¹ØÎĵµ£º

WinodwsÏÂIIS/Apache+PHP+MySQLµÄ°²×°ÅäÖÃ

ÎÒд¹ýµÄ½Ì³Ì²»¶à£¬¶øÇҴ󲿷ֶ¼ÊÇÀ´Ô´ÓÚ±ðÈ˵Ľ̳̣¬²»¹ý£¬ÕâÀïËù½éÉܵģ¬¶¼ÊÇÈÚÈëÎÒËù×ܽáµÄ¾­Ñ飮£­£­ÒýÑÔ
¡¡¡¡
¡¡¡¡PHPµÄÖ´ÐÐЧÂÊÊÇÓÐÄ¿¹²¶ÃµÄ£¬ÕâÒ²ÊÇÎÒϲ»¶ËüµÄÔ­ÒòÖ®Ò»£¬ºÍËü³ÆΪ¾øÃî´îµµµÄMysqlÒÔ¼°ApacheÏëÈںϣ¬²»Äܲ»¾ªÌ¾ÆäЧÂÊÁË¡£PHP¸üÐÂÒ²ºÜ¿ì£¬ÕâÀïÁоÙÁËÄ¿Ç°×îа汾PHP4.3.2RC4£¨¼¸ºõûÓÐBUGÁË£¬¹À¼ÆÐ´Í ......

21¸öʵÓñãÀûµÄPHP´úÂë

1. PHP¿ÉÔĶÁËæ»ú×Ö·û´®
´Ë´úÂë
½«´´½¨Ò»¸ö¿ÉÔĶÁµÄ×Ö·û´®£¬Ê¹Æä¸ü½Ó½ü´ÊµäÖеĵ¥
´Ê£¬ÊµÓÃÇÒ¾ßÓÐÃÜÂëÑéÖ¤¹¦ÄÜ¡£
/**************
[email=*@length]*@length[/email] - length of random string (must be a
multiple of 2)
**************/
function readable_random_string($length = 6){
    $conso= ......

PHP $_GET $_POST


$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£
$_GET ±äÁ¿
$_GET ±äÁ¿ÊÇÒ»¸öÊý×飬ÄÚÈÝÊÇÓÉ HTTP GET ·½·¨·¢Ë͵ıäÁ¿Ãû³ÆºÍÖµ¡£
$_GET ±äÁ¿ÓÃÓÚÊÕ¼¯À´×Ô method="get" µÄ±íµ¥ÖеÄÖµ¡£´Ó´øÓÐ GET ·½·¨µÄ±íµ¥·¢Ë͵ÄÐÅÏ¢£¬¶ÔÈκÎÈ˶¼ÊǿɼûµÄ£¨»áÏÔʾÔÚä¯ÀÀÆ÷µÄµØÖ·À¸£©£¬²¢ÇÒ¶Ô·¢Ë͵ÄÐÅÏ¢Á¿Ò²ÓÐÏÞÖÆ£¨×î¶à 100 ¸ö ......

PHP³õѧÕßÍ·Í´µÄÊ®ËĸöÎÊÌâ

1.Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿
get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
 
2.Win32 ......

CentOS apache+mysql+php°²×°

CENTOS 5µÄÐéÄâ»ú£¬Ôõô´ÓͼÐνçÃæÇл»µ½ÃüÁîÐнçÃæ
1.ÁÙʱÇл»£º
ctrl+alt+1 …… ctrl+alt+6Ò»¹²Áù¸ö¿ØÖÆ̨¡£
2.ÓÀ¾Ã¹Ø±ÕͼÐλ¯£º
ÔÚrootÏÂÊäÈë vi /etc/inittab ½«init:5ÐÞ¸ÄΪinit:3 
Mysql rpm°ü°²×°£¬²»ÄÜÖض¨Î»(relocatable)
rpm°ü°²×°Òì³££¬--prefix ²ÎÊý²»ÄÜÖض¨Î»£¬°²×°µ½ÁíÒ»¸öĿ¼µÄÔ­ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ