Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

PHPץȡÐÂÀ˶ÁÊéƵµÀµÄС˵£¬Éú³Éµç×ÓÊé

//Ï뿴ʲôµç×ÓÊ飬ÏÈÈ¥ÐÂÀ˶ÁÊéËÑË÷£¬È»ºóÌîÈë¶ÔÓ¦µÄ²ÎÊý¼´¿É
//http://vip.book.sina.com.cn/
//µç×ÓÊé²ÎÊý
$array_book[0] = 38884;     //С˵id
$array_book[1] = 22172;    //Õ½ÚÆðʼid
$array_book[2] = 32533;   //Õ½ڽáÊøid
$array_book[3] = 'ÖйúÌØÖÖ²¿¶ÓÉú´æʵ¼£ºÀÇÑÀ';     //С˵Ãû×Ö
   
//Æ¥Åä²ÎÊý
$title_pre = "/<h1>(.*?)<\/h1>/";        //±êÌⲿ·Ö
$contents_pre = "/<div id=\"contTxt\" class=\"contTxt1\">(.*?)<\/div>/";    //ÄÚÈݲ¿·Ö
//Éú³Éµç×ÓÊé
for( $i = $array_book[1]; $i <= $array_book[2]; $i++){
        $url = "http://vip.book.sina.com.cn/book/chapter_{$array_book[0]}_{$i}.html";
        $html = file_get_contents($url);
        preg_match_all($title_pre,$html,$title);
        preg_match_all($contents_pre,$html,$contents);
        $fh = fopen($array_book[3].'.txt','a+');
        $write_contents = $title[1][0]."\r\n".str_replace('</p>',"\r\n",str_replace('<p>',' ',$contents[1][0]))."\r\n";
        if( fwrite($fh,$write_contents) ){
            echo 'µÚ'.$i.'½ÚץȡÍê±Ï< /br>';
        }
        fclose($fh);
}


Ïà¹ØÎĵµ£º

PHPÊýѧº¯Êý£¨È«£©


Êýѧº¯Êý
Abs
º¯ÊýÃèÊö£ºmixed abs(mixed number);
·µ»ØÖµ£ºº¯Êýabs·µ»Ø²ÎÊýnumberµÄ¾ø¶ÔÖµ¡£
Acos
º¯ÊýÃèÊö£ºdouble acos(double number);
·µ»ØÖµ£ºº¯Êýacos·µ»Ø²ÎÊýnumberµÄ·´ÓàÏÒÖµ¡£Èç¹û²ÎÊýnumber´óÓÚ1»òСÓÚ1£¬
ÔòÆä·´ÓàÏÒÖµÎÞÒâÒå ¡£
Acosh --
·´Ë«ÇúÓàÏÒ
Asin
º¯ÊýÃèÊö£»double asin(double number); ......

apache phpÔ´Âë°²×°

 Ò»¡¢apache Ô´Âë°²×°
./configure --prefix=/usr/local/apache --enable-so
make
make install
×¢£º°²×°ºóÈç¹û¸Ä±äapacheÆðʼĿ¼(¹¤×÷Ŀ¼)£¬¿ÉÄÜ»á³öÏÖ403´íÎ󣬴ËʱÐÞ¸Ähttpd.confÖеÄUserºÍGroupΪÄã¸Ä±äºó
     µÄÆðʼĿ¼ËùÊôµÄÓû§ºÍ×é¼´¿É£¡
     ÈçrootÓû§° ......

Ò»´ÎNginx+PHP+MysqlµÄ²¢·¢²âÊÔ¾­Àú

 Ò»´ÎNginx+PHP+MysqlµÄ²¢·¢²âÊÔ¾­Àú
  Ò»¡¢Ó²¼þ»·¾³
      CPU:4ºËIntel(R) Xeon(R) CPU           E5504  @ 2.00GHz
      6GÄڴ棬120GÓ²ÅÌ
  ¶þ¡¢Èí¼þ»·¾³
     L ......

Ò»Àý½Ï³É¹¦µÄ¹ú²úPHPÎʾíµ÷²éϵͳ

 
Ô­ÎÄÄÚÈÝ
£º
ͻ񻣼
½ÏÔçµÄʱºò£¬ÓиöÅóÓѼ«Á¦ÍƼöÎÒÈ¥¿´¿´Ò»¿îPHPÎʾíµ÷²éϵͳ¡£ÎÒËäÈ»´ÓÊÂÈí¼þÁìÓòµÄʱ¼ä
²¢²»Ì«³¤£¬µ«Ò²ÖªµÀ¹úÄÚÔÚÕâ¸öÁìÓòÑо¿ºÍ´ÓʵÄÆóÒµºÍ¸öÈ˲¢²»ÉÙ£¬Ö®Ç°Ò²¹Ø×¢¹ýºÍÆÀ¹À¹ýһЩ²úÆ·»òϵͳ£¬×ÜÌåÉÏ¿´À´£¬´ó¶àÊý²úÆ·µÄÉÌÒµ»¯³Ì¶È²»¸ß£¬ÖÊÁ¿²Î
²î²»Æ룬Àë³ÉÊìµÄÈí¼þϵͳ»¹ÓÐÏ൱һ¸ö¾àÀë¡ ......

php´¦ÀíÉÏ´«Îļþ

¹«Ë¾MMʱ³£¸øÎÒһЩºÅÂë,È»ÎÒ²éѯÊÇÄļҵÄ,¶¼ÊÇtxtÎı¾¸ñʽµÄ,»¹ºÃºÅÂëÊÇÒ»ÐÐÒ»¸ö,ÓÚÊÇÓÃfile()º¯ÊýÈ¡¸öÊý×é,¿ªÊ¼µÄʱºòÎÒµÄwin7 32λµÄ¿ÉÒÔÓÃapacheºóÀ´×°64λwin7ÓÉÓÚûÕÒµ½Ô­ÉúµÄ64λapacheÓÚÊǾʹ«µ½·þÎñÆ÷ÉÏÿ´Î,ÓÐÉÏ´«ÓиÃÎļþºÜÂé·³,ÓÚÊÇ×ö³ÉÒ»¸öÒ³ÃæÈ¥ÈÃMM×Ô¼ºÍê³É.·Ï»°²»¶à˵ ÒªÔÚform±íµ¥ÀïÉÏ´«Îļþ¾ÍµÃÐèÒªÔÚ±í ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ