PHP»º´æ¼¼Êõ£ºmemcacheº¯ÊýÏê½âÖ®¶þ
memcache::debug
bool memcache_debug ( bool $on_off )
˵Ã÷£º
¿ØÖƵ÷ÊÔ¹¦ÄÜ£¬Ç°ÌáÊÇphpÔÚ±àÒëµÄʱºòʹÓÃÁË-enable-debugÑ¡Ï·ñÔòÕâ¸öº¯Êý²»»áÓÐ×÷Óá£
²ÎÊý£º
$on_off£ºtrue±íʾ¿ªÆôµ÷ÊÔ£¬false±íʾ¹Ø±Õµ÷ÊÔ
·µ»ØÖµ£º
Èç¹ûphpÔÚ±àÒëµÄʱºòʹÓÃÁË-enable-debugÑ¡Ï·µ»Øtrue£¬·ñÔò·µ»Øfalse
Memcache::decrementÓ÷¨
int Memcache::decrement ( string $key [, int $value ] )
˵Ã÷£º
Memcache::decremen·½·¨µÄ×÷ÓÃÊǶԱ£´æµÄij¸ökeyÖеÄÖµ½øÐмõ·¨²Ù×÷£¬Ó÷¨¸úMemcache::incrementÀàËÆ¡£
ÄãÒ²¿ÉÒÔÓÃmemcache_decrement()º¯Êý¡£
²ÎÊý£º
Key:ÏëÒª¼õÉٵļüµÄÃû×Ö
Value:ÏëÒª¼õÉÙµÄÖµ¡£
·µ»ØÖµ£º
Èç¹û³É¹¦£¬·µ»Ø±»¼õÉÙºóµÄÖµ£¬Èç¹ûʧ°Ü·µ»Øfalse¡£
Àý×Ó£º
<?php
$memcache = new Memcache;
$memcache->connect(’localhost’, 11211);
$memcache->set(’test_item’, 8);
$memcache->increment(’test_item’, 4);
echo $memcache->decrement(’test_item’, 7);
// ÏÔʾ 5
?>
Õâ¸öÀý×ÓÁ¬Memcache::incrementº¯Êý¶¼Ò»¿éÑÝʾÁË¡£
Memcache::deleteÓ÷¨
bool Memcache::delete ( string $key [, int $timeout ] )
˵Ã÷£º
ɾ³ýÒ»¸ökeyÖµ£¬Èç¹û²ÎÊý$timeout±»ÉèÖã¬ÄÇô´æ´¢µÄÖµ»áÔÚÉèÖõÄÃëÊýÒÔºó¹ýÆÚ£¬ÄãÒ²¿ÉÒÔÓú¯Êýmemcache_delete()
·µ»ØÖµ£º
Èç¹û³É¹¦Ôò·µ»Ø TRUE£¬Ê§°ÜÔò·µ»Ø FALSE¡£
Àý×Ó£º
<?php
/* ÃæÏò¹ý³Ì API */
$memcache_obj = memcache_connect(’memcache_host’, 11211);
/* ÔÚ10ÃëÒԺ󣬻º´æµÄÖµ»á±»·þÎñÆ÷ɾ³ý */
memcache_delete($memcache_obj, ’key_to_delete’, 10);
/* ÃæÏò¶ÔÏó API */
$memcache_obj = new Memcache;
$memcache_obj->connect(’memcache_host’, 11211);
$memcache_obj->delete(’key_to_delete’, 10);
?>
Memcache::flush
bool Memcache::flush ( void )
˵Ã÷£º
Çå³ýËùÓлº´æµÄÊý¾Ý¡£Memcache::flushʵ¼ÊÉÏûÓÐÊÍ·Å×ÊÔ´£¬Ëü½ö½ö½«ËùÓеĻº´æ±ê¼ÇΪ¹ýÆÚ£¬ÕâÑù¿ÉÒÔʹеĻº´æÀ´¸²¸Ç±»Õ¼µÄÄÚ´æ¿Õ¼ä¡£Ò»ÑùµÄº¯ÊýÊÇmemcache_flush()
·µ»ØÖµ£º
Èç¹û³É¹¦Ôò·µ»Ø TRUE£¬Ê§°ÜÔò·µ»Ø FALSE¡£
Àý×Ó£º
<?php
/* ÃæÏò¹ý³Ì API */
Ïà¹ØÎĵµ£º
1¡¢µ½Î¢Èí¹Ù·½È¥ÏÂÔØеÄÇý¶¯£¬ÏÂÔصØÖ·ÈçÏ£º
http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9
¡¡¡¡¹Ù·½ÎĵµÓÐÃèÊö£º
¡¡¡¡Refer to the documentation that is installed with the driver for a description of the new features in this ......
PHP×Ö·û´®º¯Êý´óÈ«
AddSlashes: ×Ö·û´®¼ÓÈëбÏß¡£
bin2hex: ¶þ½øλת³ÉÊ®Áù½øλ¡£
Chop: È¥³ýÁ¬Ðø¿Õ°×¡£
Chr: ·µ»ØÐòÊýÖµµÄ×Ö·û¡£
chunk_split: ½«×Ö·û´®·Ö³ÉС¶Î¡£
convert_cyr_string: ת»»¹Å˹À·ò×Ö·û´®³ÉÆäËü×Ö·û´®¡£
crypt: ½«×Ö·û´®Óà DES ±àÂë¼ÓÃÜ¡£
echo: Êä³ö×Ö·û´®¡£
explode: Çпª×Ö·û´®¡£
flush: Çå ......
i ×î³£¼ûµÄ,´óСдºöÂÔģʽ. m (PCRE_MULTILINE) ¶àÐÐģʽ.ĬÈÏÇé¿öÏÂ,PCRE½«Ä¿±ê×Ö·û´®×÷Ϊµ¥Ò»µÄÒ»"ÐÐ"×Ö·ûËù×é³ÉµÄ£¨ÉõÖÁÆäÖаüº¬Óл»ÐзûÒ²ÊÇÈç´Ë)."ÐÐÆðʼ"Ôª×Ö·û£¨^£©½ö½öÆ¥Åä×Ö·û´®µÄÆðʼ,"ÐнáÊø"Ôª×Ö·û£¨$£©½ö½öÆ¥Åä×Ö·û´®µÄ½áÊø£¬»òÕß×îºóÒ»¸ö×Ö·ûÊÇ»»ÐзûʱÆäÇ°Ã棨³ý·ÇÉ趨ÁË D ÐÞÕý·û£©.ÕâºÍ Perl ÊÇÒ»ÑùµÄ.µ ......
linuxÏÂapache+php°²×°³£¼ûÎÊÌâ
configure: error: Unable to find libgd.(a|so)
Èç¹ûʹÓõÄÊÇubuntu»òdebian¾ÍºÜ¼òµ¥ÁË£¬Ö±½Ósudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd ¾Í»ù±¾Éϸ㶨£¬µ«ÊÇÓÃÔ´´úÂë°²×°»¹ÊǺÜÂé·³¡«
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11 ......
Memcacheº¯Êý¿âÊÇÔÚPECL(PHP Extension Community Library)ÖУ¬Ö÷Òª×÷ÓÃÊǴ´óÈÝÁ¿µÄÄÚ´æÊý¾ÝµÄÁÙʱ´æ·ÅÇøÓò£¬ÔÚ·Ö²¼Ê½µÄʱºò×÷ÓÃÌåÏֵķdz£Ã÷ÏÔ£¬·ñÔò²»½¨ÒéʹÓá£
memcacheº¯ÊýËùÓеķ½·¨ÁбíÈçÏ£º
²Î¿¼http://www.php.net/manual/zh/function.Memcache-add.php
Memcache::add – Ìí¼ÓÒ»¸öÖµ£¬Èç¹ûÒѾ´æÔÚ£¬Ô ......