Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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µÄÈÕÆÚʱ¼äº¯Êý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¸öËõÐ´× ......

phpɾ³ýÎļþºÍÕû¸öÎļþ¼Ð

function delfile($dir)
{
if (is_dir($dir))
{
$dh=opendir($dir);
while (false !== ( $file = readdir ($dh)))
{
if($file!="." && $file!="..")
{
$fullpath=$dir."/".$file;
if(!is_dir($fullpath))
{
unlink($fullpath);
} ......

PHPÖнâ¾ö°²×°IMAPÀ©Õ¹


ÔÚÅäÖÃeventumµÄÓʼþ·þÎñµÄʱºò£¬Ê¼ÖÕ²»ÄÜ·¢Óʼþ¡£×¥°üºó·¢ÏÖ¸ù±¾¾ÍûÓÐÁ¬½Óµ½Óʼþ·þÎñÆ÷¡£ÔÙÒ»²é£¬Ô­À´ÊÇ·þÎñÆ÷ôÓÐ
°²×°IMAP¡£ÏÂÃæÊÇ°²×°Ç°ÕÒµ½µÄ×ÊÁÏ~~~
¡¾×ªÔØ¡¿
°²×°sugarcrm£¬Èç¹ûÄã²»°²×°imap£¬ÄÇôÄã¾ÍÎÞ·¨Ê¹ÓõÄËûµÄÓʼþ¹¦ÄÜ£¬ËûµÄÓʼþ¹¦ÄÜÊÇͨ¹ýimapÈ¥¶ÁÔ¶³ÌµÄÓʼþ¡£
ΪÁËÕâ¸öÄ£¿é£¬ÎÒ¿ÉÊÇÑо¿ÁËÒ»¸öÏÂÎ磬 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ