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 =&n
Ïà¹ØÎĵµ£º
apache°²×°£¬mysql°²×°£¬php5Ö±½Ó½âѹ£¬¾ù·ÅÔÚD:\wwwÏ¡£
Ŀ¼½á¹¹Îª£º
D:\www\apache2
D:\www\mysql
D:\www\php5
½«php5\php.ini-dist¸´ÖÆΪphp.ini£¬°ÑÐèÒªÓõ½µÄ×é¼þ½«Ç°ÃæµÄ;È¥µô¡£
Èç
extension=php_mysql.dll
extension=php_gd2.dll
ÔÚapache2µÄconf/httpd.confÎļþÖмÓ
LoadFile D:/www/php5/php5ts.dll
......
/*************Ê®½øÖÆ´óÕûÊýÏà³Ë****************/
/*********
* $A£¬$B¾ùΪ×Ö·û´®
*/
function multipication ($A,$B){
$sResult = "";
  ......
PHP·ÃÎÊMySQLÊý¾Ý¿âº¯Êý¼ò½é
1. ½øÐÐÊý¾Ý¿âÁ¬½Ó
Á¬½ÓÊý¾Ý¿â·þÎñÆ÷£¬¾ÍÊÇ¿Í»§¶ËÏò¼ºÔËÐеÄÊý¾Ý¿â·þÎñÆ÷·¢³öÁ¬½ÓÇëÇó£¬
³É¹¦ÒÔºó¾Í¿ÉÒÔ¶ÔÊý¾Ý¿â½øÐÐÏàÓ¦²Ù×÷£¬ÓÉÓÚÓû§µÄȨÏÞ²»Í¬£¬ËùÄܽø
ÐеIJÙ×÷Ò²²»Ò»Ñù¡£PHPÌṩÁËһϵÁÐMySQL ......
i ×î³£¼ûµÄ,´óСдºöÂÔģʽ. m (PCRE_MULTILINE) ¶àÐÐģʽ.ĬÈÏÇé¿öÏÂ,PCRE½«Ä¿±ê×Ö·û´®×÷Ϊµ¥Ò»µÄÒ»"ÐÐ"×Ö·ûËù×é³ÉµÄ£¨ÉõÖÁÆäÖаüº¬Óл»ÐзûÒ²ÊÇÈç´Ë)."ÐÐÆðʼ"Ôª×Ö·û£¨^£©½ö½öÆ¥Åä×Ö·û´®µÄÆðʼ,"ÐнáÊø"Ôª×Ö·û£¨$£©½ö½öÆ¥Åä×Ö·û´®µÄ½áÊø£¬»òÕß×îºóÒ»¸ö×Ö·ûÊÇ»»ÐзûʱÆäÇ°Ã棨³ý·ÇÉ趨ÁË D ÐÞÕý·û£©.ÕâºÍ Perl ÊÇÒ»ÑùµÄ.µ ......