PHP ÅÅÐòËã·¨½âÎö
<?
//²åÈëÅÅÐò£¨Ò»Î¬Êý×飩
function insert_sort($arr){
¡¡$count = count($arr);
¡¡for($i=1; $i<$count; $i++){
¡¡¡¡$tmp = $arr[$i];
¡¡¡¡$j = $i - 1;
¡¡¡¡while($arr[$j] > $tmp){
¡¡¡¡¡¡$arr[$j+1] = $arr[$j];
¡¡¡¡¡¡$arr[$j] = $tmp;
¡¡¡¡¡¡$j--;
¡¡¡¡}
¡¡}
¡¡return $arr;
}
¡¡¡¡
//Ñ¡ÔñÅÅÐò£¨Ò»Î¬Êý×飩
function select_sort($arr){
¡¡$count = count($arr);
¡¡for($i=0; $i<$count; $i++){
¡¡¡¡$k = $i;
¡¡¡¡for($j=$i+1; $j<$count; $j++){
¡¡¡¡¡¡if ($arr[$k] > $arr[$j])
¡¡¡¡¡¡¡¡$k = $j;
¡¡¡¡¡¡if ($k != $i){
¡¡¡¡¡¡¡¡$tmp = $arr[$i];
¡¡¡¡¡¡¡¡$arr[$i] = $arr[$k];
¡¡¡¡¡¡¡¡$arr[$k] = $tmp;
¡¡¡¡¡¡}
¡¡¡¡}
¡¡}
¡¡return $arr;
}
¡¡¡¡
//ðÅÝÅÅÐò£¨Ò»Î¬Êý×飩
function bubble_sort($array){
¡¡$count = count($array);
¡¡if ($count <= 0) return false;
¡¡
¡¡for($i=0; $i<$count; $i++){
¡¡¡¡for($j=$count-1; $j>$i; $j--){
¡¡¡¡¡¡if ($array[$j] < $array[$j-1]){
¡¡¡¡¡¡¡¡$tmp = $array[$j];
¡¡¡¡¡¡¡¡$array[$j] = $array[$j-1];
¡¡¡¡¡¡¡¡$array[$j-1] = $tmp;
¡¡¡¡¡¡}
¡¡¡¡}
¡¡}
¡¡return $array;
}
¡¡¡¡
//¿ìËÙÅÅÐò£¨Ò»Î¬Êý×飩
function quick_sort($array){
¡¡if (count($array) <= 1) return $array;
¡¡¡¡
¡¡$key = $array[0];
¡¡$left_arr = array();
¡¡$right_arr = array();
¡¡for ($i=1; $i<count($array); $i++){
¡¡¡¡if ($array[$i] <= $key)
¡¡¡¡¡¡$left_arr[] = $array[$i];
¡¡¡¡else
¡¡¡¡¡¡$right_arr[] = $array[$i];
¡¡}
¡¡$left_arr = quick_sort($left_arr);
¡¡$right_arr = quick_sort($right_arr);
¡¡
¡¡return array_merge($left_arr, array($key), $right_arr);
}
¡¡¡¡
?>
Ïà¹ØÎĵµ£º
Ô´ÂëĿ¼£º/usr/local/src/
Ó¦ÓÃĿ¼£º/usr/local/app/
Ò»¡¢MYSQL°²×°¡£
1.ÏÂÔØMSYQLÔ´Â룺
http://www.mysql.com/downloads/mysql/
×î½ü°æ±¾ÊÇ mysql-5.1.47.tar.gz
2.ÉÏ´«µ½·þÎñÆ÷Ŀ¼/usr/local/src/
cd /usr/local/src/
tar zxvf mysql-5.1.47.tar.gz
cd mysql-5.1.47
./configure --prefi ......
Õ¾µã½á¹¹
´úÂë:
Õ¾µã
©»includes
©»class.inc
©Çtemplet
©»index.htm
©Çlist.htm
©»content.htm
©Çindex.php
©»content.php
¿â½ ......
¹ØÓÚPHPµÄǰ;£¨¶þ£© £¨À´×Ô±¾Õ¾µÄÏûÏ¢£©
3.2ÔÚWindows 95/98/NT/2000ÉÏ¿ìËÙ°²×°Apache Web·þÎñÆ÷£¨10ÃëÖÓ£©
ÔÚWindowsÉÏÔËÐÐPHP£¬ÄãÐèÒªÒ»¸öWeb·þÎñÆ÷£¬Äã¿ÉÒÔʹÓÃ΢ÈíµÄIIS£¬Ò²¿ÉÒÔʹÓÃÃâ·ÑµÄApache ¡£ÒòΪ¿ÉÒÔͨ¹ýApacheµÄ°²×°Îļþsetup.exe½øÐа²×°£¬¿ÉÒÔΪÄã½ÚÊ¡Ðí¶àʱ¼ä¡£
PHPTtriadÊÇÒ»¸ö°üÀ¨Apache¡¢PHP¡¢MySQ ......
±êÌâÓе㳤£¬Æäʵ¾ÍÊÇÓÃÀ´Ïòhttps·þÎñÆ÷postÊý¾Ý
function curlPost($url, $data, $timeout = 30)
{
$ssl = substr($url, 0, 8) == "https://" ? TRUE : FALSE;
$ch = curl_init();
$opt = array(
CURLOPT_URL => $url,
CURLOPT_POST => 1,
CURLOPT_ ......
it is 21th of May. The Month of PHP Security
(http://www.php-security.org) is still running and we have reached a
vulnerability count of 40 vulnerabilities, which is nearly as much as we
disclosed during the whole Month of PHP Bugs in 2007. However there are
11 more days until the end of May and ......