PHPÖеÄÃæÏò¶ÔÏóºÍÃæÏò¹ý³Ì


.php{border:1px solid #cccccc;background-color:#efefef}

±¾ÎÄÕë¶ÔµÄ¶ÁÕß
±¾ÎÄÕë¶ÔÏ£ÍûÁ˽âPHPÖÐÓйØÃæÏò¶ÔÏóÓëÃæÏò¹ý³ÌÁ½ÖÖ±à³Ì·½Ê½µÄ¶ÁÕߣ¬°üÀ¨ÐÂÊÖºÍÀÏÊÖ¡£¼ÙÉè¶ÁÕ߶ÔPHP¼°ÀàµÄʹÓÃÓÐÒ»¶¨³Ì¶ÈµÄÊìϤ¡£

¼ò½é
¡°ÕæÕýµÄÌì²Å¾ßÓÐÕýÈ·ÆÀ¼Û²»È·¶¨µÄ£¬ÓзçÏÕ...

    ArrayAccess½Ó¿Ú½éÉÜ


.php{border:1px solid #cccccc;background-color:#efefef}


ÔÚ PHP5 ÖжàÁËһϵÁÐнӿڡ£ÔÚ HaoHappy ·­ÒëµÄϵÁÐÎÄÕÂÖÐ Äã¿ÉÒÔÁ˽⵽ËûÃǵÄÓ¦Óá£Í¬Ê±ÕâЩ½Ó¿ÚºÍһЩʵÏÖµÄ Class ±»¹éΪ Standard PHP Library(SPL)¡£ÔÚ PHP5 ÖмÓÈëÁ˺ܶàÌØÐÔ£¬Ê¹ÀàµÄÖØÔØ (...

    PEAR::HTML_QuickFormÓëSmarty µÄ½áºÏÓ¦ÓÃ


.php{border:1px solid #cccccc;background-color:#efefef}


HaohappyÔÚ¡¶PHP & More¡·µÚÈýÆڵġ¶PEAR::HTML_QuickFormÈëÃÅ¡·Ò»ÎÄÖÐ˵¹ýҪдQuickFormºÍSmartyµÄ½áºÏÓ¦Óã¬Ò»Ö±Ã»Ð´£¬½ñÌì¿´µ½ PHPEÂÛ̳ÉÏÓÐÅóÓÑÔÚѯÎÊ£¬Îª×Ô¼ºµÄÀÁ¶è¶ø²ÑÀ¢¡£ÏÖÔÚ²¹ÉÏ£¬Ï£Íû...

    ¸øÖíµÄ±Ç×Ó²åÒ»¸ù´Ð£¨PHP£©


.php{border:1px solid #cccccc;background-color:#efefef}

PHP ¾ß±¸Ò»Ð©¶¯Ì¬ÓïÑÔµÄÌØÕ÷, µ«²»³¹µ×. ËäÈ» PHP µÄ±êÖ¾ÊÇһͷ´óÏó, ¿ÉÕâÍ·ÏóµÄ±Ç×ÓδÃâÌ«¶Ì, ÒÔÖ¾­³£¹»²»×Ŷ«Î÷, ·´¶øÏóÖíÁË. ±¾ÎÄÖ¼ÔÚ̽ÌÖÒ»ÖÖʹ PHP ¸ü¶¯Ì¬»¯µÄ·½·¨, Ö÷ÒªÊÇÄ£Äâ Javascript µÄ p...

    PHPʹÓÃMySQLÊý¾Ý¿âº¯ÊýÏê½â

MySQLÊý¾Ý¿âº¯ÊýÏê½â
£¨1£© int mysql_affected_rows([int link_id]);

ÔÚ¸ø¶¨µÄÁ¬½ÓÖУ¬·µ»ØÓÉ×î½üµÄDELETE¡¢INSERT¡¢REPLACE»òÕßUPDATEÓï¾äËù×÷ÓõÄÐÐÊý¡£Èç¹ûûÓÐÐÐ ±»Ð޸ģ¬Ôòmysql_affected_rows()·µ»Ø0£¬Èç¹û³öÏÖ´íÎó£¬Ôò·µ»Ø-1¡£
ÔÚSELECT²éѯ֮ºó£¬mysql...

    ASP·À·¶SQL×¢Èë¹¥»÷µÄ°ì·¨

¡¡¡¡½ü¶Îʱ¼äÓÉÓÚÐÞ¸ÄÒ»¸öASP³ÌÐò(ÓÐSQL×¢È멶´)£¬ÔÚÍøÉÏÕÒÁ˺ܶàÏà¹ØµÄһЩ·À·¶°ì·¨£¬¶¼²»½üÈËÒ⣬ËùÒÔÎÒ½«ÏÖÔÚÍøÉϵÄһЩ·½·¨×ۺϸÄÁ¼ÁËһϣ¬Ð´³öÕâ¸öASPº¯Êý£¬¹©´ó¼Ò²Î¿¼¡£




ÒÔÏÂÊÇÒýÓÃƬ¶Î£º
Function Safe...

    PHP·ÖÒ³ÏÔʾÏê½â


.php{border:1px solid #cccccc;background-color:#efefef;padding:8px;}

1¡¢Ç°ÑÔ
·ÖÒ³ÏÔʾÊÇÒ»Öַdz£³£¼ûµÄä¯ÀÀºÍÏÔʾ´óÁ¿Êý¾ÝµÄ·½·¨£¬ÊôÓÚweb±à³ÌÖÐ×î³£´¦ÀíµÄʼþÖ®Ò»¡£¶ÔÓÚweb±à³ÌµÄÀÏÊÖÀ´Ëµ£¬±àдÕâÖÖ´úÂëʵÔÚÊǺͺôÎüÒ» Ñù×ÔÈ»£¬µ«ÊǶÔÓÚ³õѧÕßÀ´Ëµ£¬³£...

    PHP¼ÓËÙÆ÷ eaccelerator Ïêϸ½éÉÜ

´ó¶àPHP³ÌÐò£¬¶¼ÒªÔÚ·þÎñÆ÷¶Ë°²×°¼ÓËÙÆ÷£¬ÒÔÌá¸ß³ÌÐò³ÌÐòЧÂÊ¡£ÎÒÃÇËù½éÉܵÄÕâ¿îeaccelerator¼ÓËÙÆ÷£¬Êµ¼ÊÉÏÊÇÒ»¸ö×ÔÓÉÈí¼þ£¬Ä¿Ç°ÈÔÊÇÃâ·ÑµÄ£»Õâ¶ÔÓÚ½ÚÊ¡·þÎñ¼ÜÉè³É±¾À´Ëµ£¬Ò²ÊÇÒ»¸ö²»´íµÄÑ¡Ôñ£»

    Linux°²×°ICE¡¢IcePHPÈ«¹ý³Ì

wget http://****/Ice-3.2.1.tar.gz
tar zxvf Ice-3.2.1.tar.gz
/*************/

libdb_cxx-4.2.so(´ø×Å°æ±¾ºÅ)¶ø²»ÊÇlibdb_cxx.so,½â¾öµÄ°ì·¨ÊÇ:

ln -s /usr/lib/libdb_cxx-4.2.so /usr/lib/libdb_cxx.so

ln -s /usr/lib/libdb_cxx-4.2.a /usr/lib/libdb...

    PHP¶àÎļþÅúÁ¿ÉÏ´«Àà

<?php
class uploadfile {
    /**
     * ¸ÃÀàÖ§³Ö¶àÎļþÉÏ´«
     * ʹÓ㺳õʼ»¯Ê±²ÎÊý$filesµÄֵΪ$_FILESÊý×飬$dirֵΪÉÏ´«Îļþн¨Ä¿Â¼
     * ͨ¹ýsetMaxSize($size)Éè...

    Adodb for phpµÄExcuteʹÓ÷½·¨

Execute SQL statement $sql and return derived class of ADORecordSet if successful. Note that a record set is always returned on success, even if we are executing an insert or update statement. You can also pass in $sql a statement prepared i...

    ʹÓÃPHPÖеÄ×Ö·û´®º¯Êý

PHPÖеÄ×Ö·û´®²Ù×÷¹¦ÄÜÊDZȽ϶àµÄ,ÖØÒªµÄÓÐÒÔÏÂÕâЩ:  

(1)echo,print,printf,sprintf 
Ç°Á½¸öº¯ÊýÊÇÊä³ö×Ö·û´®.×Ö·û´®ÖÐÈç¹ûÓбäÁ¿ÃûÔò±»Ìæ»»³ÉÆäÖµ.  
ºóÁ½¸öº¯ÊýÀàËÆÓÚCµÄͬÃûº¯Êý. 

(2)strchr,strlen,strtok,strrchr,strrev,str...

    Ò»¸öÈ«Ãæ»ñȡͼÏóÐÅÏ¢µÄº¯ÊýgetImageInfo()

<?php

function getImageInfo($img) { //$imgΪͼÏóÎļþ¾ø¶Ô·¾¶
$img_info = getimagesize($img);
switch ($img_info[2]) {
case 1:
$imgtype = "GIF";
break;
case 2:
$imgtype = "JPG";
break;
case 3:
$imgtype = "PNG";
break;
...

    PHPÖÐʹÓÃheader·¢ËÍÍ·²¿ÐÅÏ¢

header¿ÉÒÔËͳöStatus±êÍ·£¬Èç
<?php

header("Status: 404 Not Found");

?>

¾Í¿ÉÒÔÈÃÓû§ä¯ÀÀÆ÷³öÏÖÎļþÕÒ²»µ½µÄ404´íÎ󣬵«ÊÇÎÒÊÔÁËÕâÑùÊDz»Ðеġ£

ºóÀ´ÎÒµ½w3.orgÉϲéÁËhttpµÄÏà¹Ø×ÊÁÏ£¬ÖÕÓÚÊÔ³öÀ´ÁËÈçºÎHeader³ö״̬´úÂë(Status)£¬Óë´ó¼Ò·ÖÏí...

    ×îÐÂPHP·ÖÒ³Àà

ÍøÂçÉÏÓÐN¶à°æ±¾µÄ·ÖÒ³À࣬ºÃÓÃÇÒÈËÐÔ»¯µÄ²»¶à£¬×î½ü±ÊÕ߸ù¾ÝÍøÂçÉÏÏÖÓеijÌÐòÐÞ¸ÄÁËһϣ¬Ôö¼ÓÁËPHP°æ±¾¼æÈÝÐÔ£¬ÌØÏ׸ø¶ÁÕß¡£

    phpÖÐrename()º¯ÊýµÄÃîÓÃ


´ó¼Ò¶¼ÖªµÀ£¬rename()º¯Êý¿ÉÒÔ¶ÔÎļþ»òĿ¼½øÐÐÖØÃüÃûµÄ²Ù×÷¡£ÆäʵËü»¹¿ÉÒÔ×öºÜ¶àÊÂÇé¡£
ÊìϤunixµÄÅóÓÑÓ¦¸ÃÖªµÀshellÃüÁîmv£¬ËüÏ൱Óëwin32µÄÒƶ¯£¬¶øÇÒÒƶ¯µÄͬʱ¿É½øÐÐÖØÃüÃû¡£ÎÒ·¢ÏÖ£¬phpµÄrename()º¯Êý¾ÍÏ൱ÓÚmv£¬Ëü²»½ö½öÖ»Óмòµ¥µÄÖØÃüÃûµÄ¹¦ÄÜ£¬Í¬Ñù¿ÉÒÔ...

    PHPÖеÄÈÕÆÚ´¦Àí

ÎÒÕý´òËãÓÃPHP±àдһÖÖ°ïÖú´¦Àíϵͳ¡£ÎÒ·¢ÏÖÎÒ±ØÐëÖªµÀ´¦ÀíÍê×îºóһλ¿Í»§µÄÎÊÌâºóÒѾ­¹ýÈ¥Á˶೤ʱ¼ä£¿µ±ÎÒ¹ýÈ¥ÓÃASPʱ½â¾öÕâ¸öÎÊÌâÏ൱¼ò µ¥£¬ASPÓÐÏàÓ¦µÄº¯ÊýDateDiff¿ÉÒÔ¸ø³öÁ½¸öÈÕÆÚ¼ä¼ä¸ô¶àÉÙÔ¡¢¶àÉÙÌìºÍ¶àÉÙÃë¡£µ±ÎÒËÑÑ°ÍêPHPÊÖ²áºóÎÒ·¢ÏÖPHP²¢Ã»ÓÐÀàËƵĺ¯...

    PHP¿ØÖÆä¯ÀÀÆ÷cache

 Output Control º¯Êý¿ÉÒÔÈÃÄã×ÔÓÉ¿ØÖƽű¾ÖÐÊý¾ÝµÄÊä³ö¡£Ëü·Ç³£µØÓÐÓã¬ÌرðÊǶÔÓÚ£ºµ±ÄãÏëÔÚÊý¾ÝÒѾ­Êä³öºó£¬ÔÙÊä³öÎļþÍ·µÄÇé¿ö¡£Êä³ö¿ØÖƺ¯Êý²»¶ÔʹÓà header() »ò setcookie(), ·¢Ë͵ÄÎļþÍ·ÐÅÏ¢²úÉúÓ°Ïì,Ö»¶ÔÄÇЩÀàËÆÓÚ echo() ºÍ PHP ´úÂëµÄÊý¾Ý¿éÓÐ×÷ÓÃ...

    ʹÓÃ"º¯ÊýµÝ¹é"ʵÏÖ»ùÓÚphpºÍMySQLµÄ¶¯Ì¬Ê÷ÐͲ˵¥

Ê÷ÐͲ˵¥Ôںܶà×ÀÃæÓ¦ÓÃϵͳÖж¼Óзdz£¹ã·ºµÄÓ¦Óã¬ÆäÖ÷ÒªÓŵãÊǽṹÇåÎú£¬ÀûÓÚʹÓÃÕ߷dz£Çå³þµÄÖªµÀÄ¿Ç°×Ô¼ºËùÔÚµÄλÖᣵ«ÔÚwebÉÏÊ÷ÐͲ˵¥µÄÓ¦ÓÃÒòΪûÓÐÀíÏëµÄÏÖ³É×é¼þ¿ÉÒÔÄùýÀ´Ö±½ÓʹÓã¬ËùÒÔÒ»°ãµÄÇé¿öÏ£¬³ÌÐòÔ±Ö÷ÒªÊÇͨ¹ýJavaScriptÀ´ÊµÏÖһЩ¼òµ¥µÄÊ÷Ðͽṹ...

    PHPÊä³öÐÅÏ¢¿ØÖƺ¯Êý½éÉÜ

ÕâЩº¯Êý¿ÉÒÔÈÃÄã¿ØÖÆÄãµÄ½Å±¾Êä³öµÄÄÚÈÝ.¿ÉÒÔÓÃÓÚÐí¶à²»Í¬µÄÇé¿ö£¬ÌرðÊÇÔÚÄãµÄ½Å±¾ÒѾ­Êä³öÐÅÏ¢ºóÐèÒª·¢ËÍÎļþͷеÄÇé¿ö. Êä³ö¿ØÖƺ¯Êý²»¶ÔʹÓà header() »ò setcookie() ·¢Ë͵ÄÎļþÍ·ÐÅÏ¢²úÉúÓ°Ïì,Ö»¶ÔÄÇЩÀàËÆÓÚ echo() ºÍ PHP ´úÂëµÄÊý¾Ý¿éÓÐ×÷ÓÃ.

Àý 1. ¿Ø...