PHPÊý¾Ý½á¹¹——¶þ·Ö²éÕÒÓë˳Ðò²éÕÒ
<?php
//--------------------
// »ù±¾Êý¾Ý½á¹¹
//--------------------
//¶þ·Ö²éÕÒ£¨Êý×éÀï²éÕÒij¸öÔªËØ£©
function bin_sch($arr, $low, $high, $k) {
if($low<=$high) {
$mid = intval(($low+$high)/2);
if($arr[$mid] == $k) {
return $mid;
} elseif($k<$arr[$mid]) {
return bin_sch($arr,$low,$mid-1,$k);
} elseif($k>$arr[$mid]) {
return bin_sch($arr,$mid+1,$high,$k);
}
}
return -1;
}
//˳Ðò²éÕÒ£¨Êý×éÀï²éÕÒij¸öÔªËØ£©
function seq_sch($array, $n, $k) {
$array[$n] = $k;
for($i=0; $i<$n; $i++) {
if($array[$i]==$k) {
break;
}
}
if($i<$n) {
return $i."The Element is here";
} else {
return '-1Sorry';
}
}
for($i=0;$i<1000000;$i++) {//²âÊÔÊý×é
$arr1[$i] = $i+1;
}
$time_start = explode(" ",microtime());
seq_sch($arr1,1000000,895624);
$time_end = explode(" ", microtime());
echo "˳Ðò²éÕÒ·¨ËùÐèÒªµÄʱ¼ä:";
echo ($time_end[0]+$time_end[1] - $time_start[0]-$time_start[1])."<br>";////²âÊÔ˳Ðò²éÕÒ·¨ËùÐèÒªµÄʱ¼ä
echo '----------------------------------——————'.'<br>';
$time_start = explode(" ",microtime());
bin_sch($arr1,0,999999,895624).'<br>';
$time_end = explode(' ', microtime());
echo "¶þ·Ö²éÕÒ·¨ËùÐèÒªµÄʱ¼ä:";
echo ($time_end[0]+$time_end[1] - $time_start[0]-$time_start[1]).'<br>';//²âÊÔ¶þ·Ö²éÕÒ·¨ËùÐèÒªµÄʱ¼ä
?>
²âÊÔ½á¹û£º
˳Ðò²éÕÒ·¨ËùÐèÒªµÄʱ¼ä:0.36866903305054
----------------------------------
¶þ·Ö²éÕÒ·¨ËùÐèÒªµÄʱ¼ä:0.00011110305786133
ÔÚÖ´ÐÐЧÂÊÉ϶þ·Ö²éÕÒ·¨Ô¶´óÓÚ˳Ðò²éÕÒ·¨
Ïà¹ØÎĵµ£º
´Ó2.2Æð SDK ½«È«ÃæÖ§³ÖUTF-8 GB2312 µÈ¶àÖÖ¸ñʽ,Ò»Ì×SDK ¾Í¿ÉÒÔ×ÔÊÊÓ¦ÄúËùÐèÒªµÄ±àÂë,
ÄÚ´øÅäÖÃÎļþ Taoapi_Config.inc.php
×îиüÐÂ
2010-02-25 Ôö¼ÓÁ˱àÂë¸ñʽ×ÔÊÊÓ¦¹¦ÄÜ
2010-02-25 Ôö¼ÓÁËAPIµ÷ÓÃÈÕÖ¾¹¦ÄÜ,ÿÐÐÏ൱ÓÚÒ»´ÎAPIµ÷ÓÃ
2010-02-25 Ôö¼ÓÁË×Ô¶¯Çå³ý»º´æµÄ»úÖÆ
2010-02-25 Ôö¼ÓAPIµ÷Óó¬¹ýÏÞÖÆÊ±×Ô¶¯Çл»µ ......
<FORM METHOD=POST ACTION="#">
<INPUT TYPE="text" NAME="name">
<INPUT TYPE="submit" value="query" name="sub">
</FORM>
<?php
function getinitial($str)
{
$asc=ord(substr($str,0,1)); //ord()»ñÈ¡ASCII
if ($asc<160) //·ÇÖÐÎÄ
{
if ($asc>=48 ......
[part1] http://download.csdn.net/source/2076258
[part2] http://download.csdn.net/source/2076272
[part3] http://download.csdn.net/source/2076276
[part4] http://download.csdn.net/source/2076283
[part02-04] http://www.ytgps.com/Images/nginx.rar
±¾ÎļþÌå»ý¹ý´ó·Ö4¸ö°ü£¬php-cgi+mysql+nginx.7z ......
ÔÚPHPÖÐʹÓÃÍ·Îļþ£¬»áÉæ¼°Á½¸öº¯Êý£ºinclude()ºÍrequire()¡£ÕâÁ½¸öº¯Êý²î±ðºÜС£¬È´ºÜÖØÒª£¬ËùÒÔÎÒÃÇÒªÈÏÕæÑо¿Ò»Ï¡£
require()º¯Êý¹¤×÷·½Ê½ÓëXSSIÏàÀàËÆ£»²»¹ÜÔÚ³ÌÐòµÄÄĸö²¿·ÖʹÓÃÁËÕâ¸öº¯Êý£¬Ö»ÓгÌÐòÒ»¿ªÊ¼ÔËÐУ¬Í·ÎļþµÄÄÚÈݾͱ»×÷Ϊ³ÌÐò±¾ÉíµÄÒ»²¿·ÖÀ´´¦
Àí¡£Òò´Ë£¬Èç¹ûÄúÔÚÒ»¸öÌõ¼þÅж¨Óï¾äÖÐʹÓÃÁËrequire()º¯Ê ......