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

PHP»º´æ¼¼Êõ£ºmemcacheº¯ÊýÏê½âÖ®Ò»

Memcacheº¯Êý¿âÊÇÔÚPECL(PHP Extension Community Library)ÖУ¬Ö÷Òª×÷ÓÃÊǴ´óÈÝÁ¿µÄÄÚ´æÊý¾ÝµÄÁÙʱ´æ·ÅÇøÓò£¬ÔÚ·Ö²¼Ê½µÄʱºò×÷ÓÃÌåÏֵķdz£Ã÷ÏÔ£¬·ñÔò²»½¨ÒéʹÓá£
memcacheº¯ÊýËùÓеķ½·¨ÁбíÈçÏ£º
²Î¿¼http://www.php.net/manual/zh/function.Memcache-add.php
Memcache::add - Ìí¼ÓÒ»¸öÖµ£¬Èç¹ûÒѾ­´æÔÚ£¬Ôò·µ»Øfalse
Memcache::addServer - Ìí¼ÓÒ»¸ö¿É¹©Ê¹ÓõķþÎñÆ÷µØÖ·
Memcache::close - ¹Ø±ÕÒ»¸öMemcache¶ÔÏó
Memcache::connect - ´´½¨Ò»¸öMemcache¶ÔÏó
memcache_debug - ¿ØÖƵ÷ÊÔ¹¦ÄÜ
Memcache::decrement - ¶Ô±£´æµÄij¸ökeyÖеÄÖµ½øÐмõ·¨²Ù×÷
Memcache::delete - ɾ³ýÒ»¸ökeyÖµ
Memcache::flush - Çå³ýËùÓлº´æµÄÊý¾Ý
Memcache::get - »ñÈ¡Ò»¸ökeyÖµ
Memcache::getExtendedStats - »ñÈ¡½ø³Ì³ØÖÐËùÓнø³ÌµÄÔËÐÐϵͳͳ¼Æ
Memcache::getServerStatus - »ñÈ¡ÔËÐзþÎñÆ÷µÄ²ÎÊý
Memcache::getStats - ·µ»Ø·þÎñÆ÷µÄһЩÔËÐÐͳ¼ÆÐÅÏ¢
Memcache::getVersion - ·µ»ØÔËÐеÄMemcacheµÄ°æ±¾ÐÅÏ¢
Memcache::increment - ¶Ô±£´æµÄij¸ökeyÖеÄÖµ½øÐмӷ¨²Ù×÷
Memcache::pconnect - ´´½¨Ò»¸öMemcacheµÄ³Ö¾ÃÁ¬½Ó¶ÔÏó
Memcache::replace -¶ÔÒ»¸öÒÑÓеÄkey½øÐи²Ð´²Ù×÷
Memcache::set - Ìí¼ÓÒ»¸öÖµ£¬Èç¹ûÒѾ­´æÔÚ£¬Ôò¸²Ð´
Memcache::setCompressThreshold - ¶Ô´óÓÚijһ´óСµÄÊý¾Ý½øÐÐѹËõ
Memcache::setServerParams - ÔÚÔËÐÐʱÐ޸ķþÎñÆ÷µÄ²ÎÊý
Memcache::addÓ÷¨
bool Memcache::add ( string $key , mixed $var [, int $flag [, int $expire ]] )
˵Ã÷£º
Èç¹û$key²»´æÔÚµÄʱºò£¬Ê¹ÓÃÕâ¸öº¯ÊýÀ´´æ´¢$varµÄÖµ¡£¹¦ÄÜÏàͬµÄº¯ÊýÊÇmemcache_add()¡£
 
²ÎÊý£º
$key £º½«Òª´æ´¢µÄ¼üÖµ¡£
$var £º´æ´¢µÄÖµ£¬×Ö·ûÐͺÍÕûÐͻᰴԭֵ±£´æ£¬ÆäËûÀàÐÍ×Ô¶¯ÐòÁл¯ÒÔºó±£´æ¡£
$flag£ºÊÇ·ñÓÃMEMCACHE_COMPRESSEDÀ´Ñ¹Ëõ´æ´¢µÄÖµ£¬true±íʾѹËõ£¬false±íʾ²»Ñ¹Ëõ¡£
$expire£º´æ´¢ÖµµÄ¹ýÆÚʱ¼ä£¬Èç¹ûΪ0±íʾ²»»á¹ýÆÚ£¬Äã¿ÉÒÔÓÃunixʱ¼ä´Á»òÕßÃèÊöÀ´±íʾ´ÓÏÖÔÚ¿ªÊ¼µÄʱ¼ä£¬µ«ÊÇÄãÔÚʹÓÃÃëÊý±íʾµÄʱºò£¬²»Òª³¬¹ý2592000Ãë (±íʾ30Ìì)¡£
 
·µ»ØÖµ£º
Èç¹û³É¹¦Ôò·µ»Ø TRUE£¬Ê§°ÜÔò·µ»Ø FALSE¡£Èç¹û$keyÖµÒѾ­´æÔÚ£¬Ôò»á·µ»ØFALSE¡£ ÆäËûÇé¿öÏÂMemcache::add()µÄÓ÷¨ÀàËÆÓÚMemcache::set()¡£
Àý×Ó£º
<?php
$memcache_obj = memcache_connect(”localhost”, 11211);
/* ÃæÏò¹ý³ÌAPI */
mem


Ïà¹ØÎĵµ£º

PHPµÄÈýµã¾«»ª½éÉÜ

 ÎÒ·¢ÏֺܶàµÄPHP³ÌÐòÔ±£¬ÓÈÆäÊÇѧϰ»¹²»ÊǺܾõģ¬¶¼²»ÖªµÀPHPµÄ¾«»ªËùÔÚ¡£Perlµ±ÄêÈçºÎÔÚÉ̽ç³öÃû£¿ÆäÇ¿´óµÄÕýÔò±í´ïʽ¡£¶øPHPÄØ£¿ËûÊÇÒ»ÃÅ´ÓUnixÏ·¢Õ¹ÆðÀ´µÄÓïÑÔ£¬µ±È»Ò²¾Í¼Ì³ÐÁËPerlµÄºÜ¶àÌص㣬ͬʱCµÄÓŵ㶼ÓС£¿ìËÙ¡¢¼ò½à¡¢Ã÷ÁË£¬ÓÈÆäÊÇC³ÌÐòÔ±£¬PHPÊÇÖÁ°®£¬ÎÒ¾ÍÊÇÉî°®×Å“PHP”£¨¶¼ÍüÁËÅ®ÓÑÁË:)£©¡ ......

PHPÊý×éµÄʹÓúͱéÀú

 1¡¢Êý×éµÄÉêÇëºÍʹÓãº
$array=array(array(2,324,34)); 
echo   $array[0][1]; 
Ö±½ÓÉêÇëʹÓãº
$student[0][0]="ÎÒ";
$student[0][1]="ÊÇ";
$student[1][0]="Ë­";
$student[1][1]="ά";
 echo   $student[1][0];
2¡¢±éÀú£º ......

PHPÖÐmysql_fetch_array()ºÍmysql_fetch_row()µÄÇø±ð

 ×î½üÔÚ×öPHPÓëÊý¾Ý¿â½»»¥µÄproject£¬¼±ÓÚÇó³É£¬Ä£·ÂÁËÏÂÀý×ӾͿªÊ¼¶¯ÊÖ£¬½á¹ûÎó°Ñmysql_fetch_arrayд³ÉÁËmysql_fetch_row,囧ÊÂÀ´ÁË£¬·¢ÏÖ·µ»ØµÄÊý×é¾ÓÈ»ÊÇindex=>valueµÄÐÎʽ£¬¶øÃ÷Ã÷¼ÇµÃÊÇfield name=>valueµÄ¹þ£¬²éÊÖ²á²ÅÃ÷°×¡£
1. mysql_fetch_arrayµÄº¯ÊýÔ­ÐÍÊÇ
array mysql_fetch_array ( resour ......

PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ

¡¡¡¡ËäÈ»PHPÊÇWebÓ¦Óÿª·¢ÖÐ×î¹ã·ºÊ¹ÓõĻ·¾³£¬µ«Ëü»¹ÊÇÒ»¶È±»ÈÏΪÎÞÔµÆóÒµ¼¶¿ª·¢¡£InfoQ×éÖ¯ÁËÒ»¸öÐéÄâ×ù̸С×éÀ´ÌÖÂÛÓïÑÔ/ƽ̨µÄÑݱ估PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ¡£
¡¡¡¡Zeev Suraski£¬Zend Technologies¹«Ë¾´´Ê¼ÈË£¬¸Ã¹«Ë¾Ö÷Òª¹Ø×¢PHPµÄ½øÕ¹¡£
¡¡¡¡Rob Nicholson£¬¸ß¼¶¼¼ÊõÑÐÔ±, ÔøΪIBM±àд¹ý³ÌÐòÉè¼ÆÓïÑÔÔËÐÐʱ¡£
¡¡¡ ......

ÔÚWindows XPÏÂÅäÖÃPHPºÍApache»·¾³

    ÔÚwindows²Ù×÷ϵͳÅäÖÃPHP»·¾³£¬¿ÉÒÔÓÃIIS×öÓ¦Ó÷þÎñÆ÷£¬Ò²¿ÉÒÔʹÓÃApache×öÓ¦Ó÷þÎñÆ÷¡£±¾ÎĽéÉÜÔÚWindows XP²Ù×÷ϵͳÏÂÅäÖÃPHPºÍApache»·¾³¡£
    ×¼±¸¹¤×÷£º
    1¡¢ÔÚhttp://windows.php.net/download/ÏÂÔØPHP³ÌÐò°ü£¬ÒòΪÓÃApache×öÓ¦Ó÷þÎñÆ÷£¬Ñ¡ÔñÓÃVC6±àÒëµÄ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ