PHPÓ¦ÓÃmemcacheº¯ÊýÏê½â
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 — R¶ÔÒ»¸öÒÑÓеÄkey½øÐи²Ð´²Ù×÷
Memcache::set — Ìí¼ÓÒ»¸öÖµ£¬Èç¹ûÒѾ´æÔÚ£¬Ôò¸²Ð´
Memcache::setCompressThreshold — ¶Ô´óÓÚijһ´óСµÄÊý¾Ý½øÐÐѹËõ
Memcache::setServerParams — ÔÚÔËÐÐʱÐ޸ķþÎñÆ÷µÄ²ÎÊý
½¨ÒéÓÃÃæÏò¶ÔÏóµÄ·½Ê½À´²âÊÔÕâ¸ö¿â£º
<?php
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
$version = $memcache->getVersion();
echo "Server's version: ".$version."
\n";
?>
Memcache::getVersion·½·¨µÄ×÷ÓÃÊÇ·µ»ØÔËÐеÄMemcacheµÄ°æ±¾ÐÅÏ¢¡£
Memcache::getStats ·½·¨µÄ×÷ÓÃÊÇ·µ»Ø·þÎñÆ÷µÄһЩÔËÐÐͳ¼ÆÐÅÏ¢¡£Memcache::getStats·½·¨ÓÐÈý¸ö²ÎÊý£¬µÚÒ»¸ö²ÎÊý±íʾҪÇ󷵻صÄÀàÐÍ£ºreset, malloc, maps, cachedump, slabs, items, sizes;µÚ¶þ¸ö²ÎÊýºÍµÚÈý¸ö²ÎÊýÊÇÔÚµÚÒ»¸ö²ÎÊýÉèÖÃΪ“cachedump”ʱʹÓõġ£Memcache::getExtendedStats·½·¨µÄ×÷ÓÃÊÇ»ñÈ¡½ø³Ì³ØÖÐËùÓнø³ÌµÄÔËÐÐϵͳͳ¼Æ¡£
<?php
$memcache = new Memcache;
$memcache->connect('localhost', 11211) or die ("Could not connect");
print_r($memcache->getStats());
/**
* Array
* (
* [pid] => 8052
* [uptime] => 9205
* [time] => 12058
Ïà¹ØÎĵµ£º
תÔØ£ºhttp://www.phpjs.cn/article_90.html
php³£ÓÃÀàÕûÀí
ʱ¼ä£º2009-12-19 20:45 À´Ô´£ºÈËÁ¦·½ ×÷Õߣºsyuanq µã»÷£º236
ÔÚʵ¼Ê¿ª·¢¹ý³Ì»á¾³£»áÓöµ½Ò»Ð©Öظ´µÄ²Ù×÷£¬Èç¹ûÿ´Î¶¼Òª×Ô¼ºÈ¥ÊµÏÖÕâÎÞÒɼÓÖØÁË×Ô¼ºµÄ¹¤×÷Á¿£¬ÏÂÃæ¶ÔһЩ¿ÉÄܾ³£Óõ½µÄÀà×ö¸öÕûÀí£º
ͼ±í¿â
ÏÂÃæµÄÀà¿â¿ÉÒÔÈÃÄãºÜ¼òµ¥¾ÍÄÜ´´½ ......
Õâ¾ÍÒª´ÓË«ÒýºÅºÍµ¥ÒýºÅµÄ×÷Óý²Æð£º
Ë«ÒýºÅÀïÃæµÄ×ֶλᾹý±àÒëÆ÷½âÊÍÈ»ºóÔÙµ±×÷HTML´úÂëÊä³ö£¬µ«Êǵ¥ÒýºÅÀïÃæµÄ²»ÐèÒª½âÊÍ£¬Ö±½ÓÊä³ö¡£ÀýÈ磺
$abc='I love u';
echo $abc //½á¹ûÊÇ:I love u
echo '$abc' //½á¹ûÊ ......
×÷Ϊһ¸öȫеĻ¥ÁªÍøÏîÄ¿£¬ÓÐʱºò»áÃæÁÙÒ»¸öÑ¡ÔñʲôÑùµÄ¿ª·¢ÓïÑÔµÄÎÊÌâ¡£
ÎÒ˵µÄÕâ¸öÓÐʱºò£¬ÆäʵÊÇÖ¸ÏÖÓеÄÍŶÓÖУ¬Ã»Óм¼Êõ¿ª·¢µÄ³ÉÔ±µÄÇé¿ö¡£Èç¹ûÒѾÓÐÁËÒ»¸ö»òÕ߶à¸ö¼¼Êõ¿ª·¢ÈËÔ±£¬µ±È»ÊÇÑ¡ÔñÏÖÓгÉÔ±×îÊìϤºÍ×îÉó¤µÄÓïÑÔÁË¡£
ÄÇô¶ÔÓÚÒ»¸ö»¹Ã»Óм¼Êõ³ÉÔ±µÄÍŶӣ¬Ó¦¸ÃÑ¡ÔñʲôÑùµÄ¿ª·¢ÓïÑÔÄØ£¿»Ø´ðÕâ¸öÎÊÌ⣬Ê×Ï ......
¶¨ÒåºÍÓ÷¨
filter_var() º¯Êýͨ¹ýÖ¸¶¨µÄ¹ýÂËÆ÷¹ýÂ˱äÁ¿¡£
Èç¹û³É¹¦£¬Ôò·µ»ØÒѹýÂ˵ÄÊý¾Ý£¬Èç¹ûʧ°Ü£¬Ôò·µ»Ø false¡£
Óï·¨
filter_var(variable, filter, options)
²ÎÊýÃèÊö
variable
±ØÐè¡£¹æ¶¨Òª¹ýÂ˵ıäÁ¿¡£
filter
¿ÉÑ¡¡£¹æ¶¨ÒªÊ¹ÓõĹýÂËÆ÷µÄ ID¡£
options
¹æ¶¨°üº¬±êÖ¾/Ñ¡ÏîµÄÊý×é¡£¼ì²éÿ¸ö¹ýÂËÆ÷¿ÉÄܵı ......
1£¬¶¨Òåheader()Í·²¿Êä³ö¸ñʽ
header("Content-type:application/vnd.ms-excel");
header("Content-Disposition:finlename=php.xls");
vnd.ms-excel -----¶¨ÒåÊä³öÎļþ¸ñ
php.xls ---------¶¨ÒåÊä³öµÄÎļþÃû
2£¬Êä³ö±à ......