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
/**
* @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= ......
´ËƪÎÄÕÂ×¼±¸·Ö2¸ö²¿·ÖÀ´½²Êö£º
µÚÒ»²¿·ÖÖ÷ÒªÏêϸ½²ÊöÒ»ÏÂÔõô¹¹½¨Ò»¸öÍê³ÉµÄC++Ó¦ÓÃÀ©Õ¹Ä£¿é£»
µÚ¶þ²¿·ÖÖ÷Òª½²ÊöÔÚPHP¼°Zend¿ò¼ÜÏÂÔõôʹÓÃZend APIºÍC++ÓïÑÔÀ´ÊµÏÖ×Ô¼ºËùÒªµÄ¹¦ÄÜÒÔ¼°ÏîÄ¿µÄ¿ª·¢£»
´ËƪÎÄÕÂËùÔËÓõĻ·¾³ÔÚLinux
2.4.21-4.ELsmp(Red Ha ......
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
//·ÖÒ³
$link=mysql_connect("localhost","root","root");
$db=mysql_select_db("bustest",$link);
$res=mysql_query("select * from info");
//Ò»¹²¶àÉÙÌõ
$count=mysql_num_rows($res);
//ÿҳ5ÌõÐÅÏ¢
$perpage=5;
//Ò»¹²¶àÉÙÒ³
$pagecount=ceil($count/$perpage);
//´«¹ýÀ´µÄÒ³Êý
$pagenum=$_REQUE ......
ĿǰLAMP (Linux + Apache + MySQL + PHP) ½ü¼¸ÄêÀ´·¢Õ¹Ñ¸ËÙ£¬ÒѾ³ÉΪWeb ·þÎñÆ÷µÄÊÂʵ±ê×¼¡£LAMP
Õâ¸ö´ÊµÄÓÉÀ´×îÔçʼÓڵ¹úÔÓÖ¾“c't Magazine”£¬Michael KunzeÔÚ1990Äê×îÏȰÑÕâЩÏîÄ¿×éºÏÔÚÒ»Æð´´ÔìÁËLAMPµÄËõд×Ö¡£ÕâЩ×é¼þËäÈ»²¢²»ÊÇ¿ª¿ªÊ¼¾ÍÉè¼ÆÎªÒ»ÆðʹÓõ쬵«ÊÇ£¬ÕâЩ¿ªÔ´Èí¼þ¶¼¿ÉÒԺܷ½±ã µÄË ......