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

PHPÖеÄstristr()£¬strstr()£¬strpos()ËٶȱȽÏ


PHPÖеÄstristr()£¬strstr()£¬strpos()ËٶȱȽÏ

²âËÙ´úÂë:

<?php
function getmicrotime()
{
list($usec, $sec) = explode(" ",microtime());
return ((float)$usec + (float)$sec);
}

$time_start = getmicrotime();
$string="xxxddxx";
$find="d";
for ($i=0;$i<300000;$i++)
{
if (stristr($string,$find))//if (strstr($string,$find)) or if (strpos($string,$find))
{}
}
$time_end = getmicrotime();
echo $time_end-$time_start;
?>

[/php]


stristr()
µÚÒ»´Î:2.74142408371
µÚ¶þ´Î:2.52075314522
µÚÈý´Î:2.52766990662

strstr()
µÚÒ»´Î:1.43941402435
µÚ¶þ´Î:1.44914388657
µÚÈý´Î:1.51285290718

strpos()
µÚÒ»´Î:1.42109084129
µÚ¶þ´Î:1.40254187584
µÚÈý´Î:1.38609910011
----------------------------------
¿ÉÒÔ¿´³ö£¬stristrÔÚ½øÐÐÅжÏijһ×Ö·û(´®)ÊÇ·ñ´æÔÚÓÚÁíÒ»×Ö·û(´®)ʱºò£¬ËÙ¶ÈÃ÷ÏÔÂýÓÚÁíÍâÁ½¸ö¡£¡£
stristr¶Ô´óСд²»Ãô¸ÐµÄ
strstr¶Ô´óСдÃô¸Ð
strpos²»ÄÜÅжÏÊÇ·ñÓÐÌØÊâ×Ö·û£¨°üÀ¨ÖÐÎÄ×Ö·û£©

ºÇºÇ£¬ÒÔºóÓõÄʱºò¼ÇµÃÑ¡ÔñºÃÀ²¡£¡£


Ïà¹ØÎĵµ£º

phpÖÐsmartyÄ£°æÒýÇæÖеĻº´æÓ¦Óã¡

1,Smarty»º´æµÄÅäÖãº
   $smarty->cache-dir="Ŀ¼Ãû";   //´´½¨»º´æÄ¿Â¼Ãû
   $smarty->caching=true;   //¿ªÆô»º´æ£¬ÎªfalseµÄʱºò»º´æÎÞЧ
   $smarty->cache_lifetime=60; //»º´æÊ±¼ä£¬µ¥Î»ÊÇÃë
2,Smarty»º´æµÄʹÓÃÓëÇå³ý
   $marty->d ......

php¶ÔzipÎļþ½âѹºÍѹËõ

<?php
/**
* @author wyt
*
*/
class zip {
private $_zipObj=null;
private $_zipfcArr=array();
private $_basePath=null;
private $_zipName;
/**
* init
* @param zipÎļþÃû³Æ $zipName
*/
function __construct($zipName){
$this->_zipName=$zipName;
$this->_zipObj= ......

PHPµÄÈÕÆÚʱ¼äº¯Êýdate()

PHPµÄÈÕÆÚʱ¼äº¯Êýdate()
1£¬Äê-ÔÂ-ÈÕ
echo date('Y-m-j');
2007-02-6
echo date('y-n-j');
07-2-6
´óдY±íʾÄêËÄλÊý×Ö£¬¶øÐ¡Ð´y±íʾÄêµÄÁ½Î»Êý×Ö£»
Сдm±íʾÔ·ݵÄÊý×Ö(´øÇ°µ¼)£¬¶øÐ¡Ð´nÔò±íʾ²»´øÇ°µ¼µÄÔ·ÝÊý×Ö¡£
echo date('Y-M-j');
2007-Feb-6
echo date('Y-m-d');
2007-02-06
´óдM±íʾÔ·ݵÄ3¸öËõÐ´× ......

HTTPServiceÓëPHPͨÐÅ

ÔÚFlexÖÐÓÐ2¸öHTTPServiceÀ࣬ËüÃǵÄÍêÕû¼Ì³Ð·¾¶·Ö±ðÊÇmx.rpc.httpºÍmx.rpc.http.mxml,¿ÉÒÔ¿´³ömx.rpc.http.mxmlÊÇmx.rpc.httpµÄ×ÓÀà¡£mx.rpc.http.mxmlÖеÄhttpServiceÖ÷ÒªÊÇΪÁËMXML±êÇ©ÖÐʹÓÃHTTPService¶øÉèµÄ¡£mx.rpc.httpÊÇÔÚʹÓÃas½Å±¾½øÐвÙ×÷ʱʹÓᣵ±µ÷Óà HTTPService ¶ÔÏóµÄ send() ·½·¨Ê±£¬½«·¢³ö¶ÔÖ¸¶¨ URL ......

PHPħÊõ³£Á¿:__LINE__ __FILE__ __CLASS__

PHP ÏòËüÔËÐеÄÈκνű¾ÌṩÁË´óÁ¿µÄÔ¤¶¨Òå³£Á¿
¡£²»¹ýºÜ¶à³£Á¿¶¼ÊÇÓɲ»Í¬µÄÀ©Õ¹¿â¶¨ÒåµÄ£¬Ö»ÓÐÔÚ¼ÓÔØÁËÕâЩÀ©Õ¹¿âʱ²Å»á³öÏÖ£¬»òÕß¶¯Ì¬¼ÓÔØºó£¬»òÕßÔÚ±àÒëʱÒѾ­°üÀ¨½øÈ¥ÁË¡£
ÓÐÎå¸öħÊõ³£Á¿¸ù¾ÝËüÃÇʹÓõÄλÖöø¸Ä±ä¡£ÀýÈç __LINE__
µÄÖµ¾ÍÒÀÀµÓÚËüÔڽű¾ÖÐËù´¦µÄÐÐÀ´¾ö¶¨¡£ÕâÐ©ÌØÊâµÄ³£Á¿²»Çø·Ö´óСд£¬ÈçÏ£º
±í 13 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ