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

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£¬Ê§°ÜÔò·µ»


Ïà¹ØÎĵµ£º

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

 <?
$_mysqlhost="localhost";
$_mysqluser="root";
$_mysqlpass="";
$_mysqldata="mydata";
$_connect=mysql_connect($_mysqlhost,$_mysqluser,$_mysqlpass) or die ("´íÎó".mysql_error());
mysql_query("SET character_set_connection=utf8, character_set_results=utf8, character_set_client=binary", $ ......

¹ØÓÚphpÀïµÄinclude

 ÔÚÒÔÇ°µÄ×öµÄÀý×ÓÖÐÓöµ½¹ýÖظ´µÄ¼ÓÔصĴíÎó ¶î ÄǸöÊÇͨ¹ýinclude_once()À´½â¾ö »òÕß²»ÈÃËûÖظ´¼ÓÔØ°ÑÖظ´µÄinclude()È¥µôÒ»¸ö»ò¶à¸ö£¬×îÖÕֻʣÏÂÒ»¸öÕâÑùÎÊÌâ¾Í½â¾öÁË£¬µ«½ñÌìÓöµ½µÄÎÊÌâ¾Í¼¬ÊÖÁË ËµÊÇÕÒ²»µ½Îļþ¡£
     ÊÂÇéÊÇÕâÑùµÄ £¬½ñÌìÔÚÎļþ¼ÐÀïÔÙн¨ÁËÒ»¸öÎļþ¼Ð£¬È»ºóÒÔÇ°includ ......

php·ÖÒ³TEST£¬×Ô¼ºÐ´Ò»ÏÂ

<?
include 'conn.php';
$_pagenob=10; //ÿҳ¹æ¶¨µÄÐÅÏ¢ÊýÄ¿
//»ñÈ¡µ±Ç°Ò³
if(isset($_GET["page"]))
{
$_page = intval( $_GET['page'] );
}
else
{
$_page=1;
}
//²éѯÊý¾Ý×ÜÊý
$_query="select count(*) as acount from news";
$_result=mysql_query($_query);
$_row=mysql_fetch_row($_result);
......

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

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