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
#--Config--#
$login_password= '123456'; //ÕâÊÇÃÜÂë
#----------#
error_reporting(E_ALL);
set_time_limit(0);
ini_set("max_execution_time","0");
ini_set("memory_limit","9999M");
set_magic_quotes_runtime(0);
if(!isset($_SERVER))$_SERVER = &$HTTP_SERVER_VARS;
if(!isset($_POST))$_PO ......
set_magic_quotes_runtimeÊÇÓÃÀ´ÉèÖÃPHP »·¾³ÅäÖõıäÁ¿ magic_quotes_runtime Öµ¡£
0-¹Ø±Õ 1-´ò¿ª
³ÌÐòÖмì²â״̬ÓÃget_magic_quotes_runtime,·µ»Ø 0 ±íʾ¹Ø±Õ±¾¹¦ÄÜ£»·µ»Ø 1 ±íʾ±¾¹¦ÄÜ´ò¿ª¡£Èô
magic_quotes_runtime ´ò¿ªÊ±£¬ËùÓÐÍⲿÒýÈëµÄÊý¾Ý¿â×ÊÁÏ»òÕßÎļþµÈµÈ¶¼»á×Ô¶¯×ªÎªº¬Óз´Ð±ÏßÒç³ö×Ö·ûµÄ×ÊÁÏ¡ ......
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);
}
......
ÔÚÅäÖÃeventumµÄÓʼþ·þÎñµÄʱºò£¬Ê¼ÖÕ²»ÄÜ·¢Óʼþ¡£×¥°üºó·¢ÏÖ¸ù±¾¾ÍûÓÐÁ¬½Óµ½Óʼþ·þÎñÆ÷¡£ÔÙÒ»²é£¬ÔÀ´ÊÇ·þÎñÆ÷ôÓÐ
°²×°IMAP¡£ÏÂÃæÊÇ°²×°Ç°ÕÒµ½µÄ×ÊÁÏ~~~
¡¾×ªÔØ¡¿
°²×°sugarcrm£¬Èç¹ûÄã²»°²×°imap£¬ÄÇôÄã¾ÍÎÞ·¨Ê¹ÓõÄËûµÄÓʼþ¹¦ÄÜ£¬ËûµÄÓʼþ¹¦ÄÜÊÇͨ¹ýimapÈ¥¶ÁÔ¶³ÌµÄÓʼþ¡£
ΪÁËÕâ¸öÄ£¿é£¬ÎÒ¿ÉÊÇÑо¿ÁËÒ»¸öÏÂÎ磬 ......