phpץȡalexaÍøÒ³ÄÚÈÝ ÌáÈ¡Õ¾µãͳ¼ÆÐÅÏ¢
ÈÎÎñ£º¸ù¾ÝÊäÈëµÄÓòÃû ͳ¼ÆÒÔÏÂÈý¸öÊý¾Ý£¬µÚÒ»£ºÈ«ÇòÅÅÃû£»µÚ¶þ£ºÓû§Á¿£¨ÔÂƽ¾ùÖµ£©£»µÚÈý£º
È˾ùÒ³Ãæ·ÃÎÊÁ¿£¨ÔÂƽ¾ùÖµ£©¡£
˼·£ºÊ¹ÓÃget_file_contentsÌáÈ¡³öÍøÒ³ÄÚÈÝ£¬ÔÙ¸ù¾ÝÕýÔò±í´ïʽ½øÐÐÄÚÈݵÄɸѡ¡£
ºËÐĺ¯ÊýÈçÏ£º
<?php
/*
the function of getting aleax data
@param string partten ;the url set
@return array partten ;
*/
function get_alexa_data($url)
{
$a_url = explode(PHP_EOL,$url);
$index = count($a_url);
if(function_exists('file_get_contents'))
{
$result = array();
$pattern = "|<div\\sclass=\"data[^\"]+?\">[^>]*?>[^>]*?([\\d,]+)\\s*?</div>[\\S\\s]*?id=\"reach[\\S\\s]*?<th>1".
"\\smonth[\\S\\s]*?class=\"avg.*?([\\d\\.]+)</td[\\S\\s]*?id=\"pageviews_per_user\"[\\S\\s]*?".
"1\\smonth[\\S\\s]*?class=\"avg.*?([\\d\\.]+)</td|";
for($i = 0; $i < $index; $i++)
{
if(!empty($a_url[$i]))
{
$content = file_get_contents('http://www.alexa.com/siteinfo/'.$a_url[$i]);
if(!preg_match($pattern,$content,$result[$a_url[$i]]))
$result[$a_url[$i]]=array('Not Found','Not Found','Not Found','Not Found');
}
}
}
else
die("the function file_get_contents not found!");
return $result;
}
?>
¸Ä±äÉÏÃæµÄÕýÔò±í´ïʽ£¬¿ÉÒÔÂú×ã×Ô¼ºµÄÁíÍâÒªÇó¡£
ÉÏÃ溯ÊýʹÓõÄÇ°ÖÃÌõ¼þÊÇ£ºalexaÌṩµÄ²éѯÍøÖ·¸ñʽ'http://www.alexa.com/siteinfo/‘²»±ä¡£
ʹÓÃÀý³Ì£º
<table>
<tr>
<td>site</td><td>È«ÇòÅÅÃû</td><td>Óû§Á¿(ÔÂƽ¾ùÖµ)</td><td>È˾ùÒ³Ãæ·ÃÎÊÁ¿(ÔÂƽ¾ùÖµ)</td>
</tr>
<?php
$alexa = get_alexa_data($_POST['url']);
foreach($al
Ïà¹ØÎĵµ£º
from£ºhttp://www.xland.com.cn/article/7/81/0804/28778.htm
±¾ÀàʵÏÖ£º
Êý¾Ý¿âÐÅÏ¢µ¼³ö£ºword£¬excel£¬json£¬xml£¬sql
Êý¾Ý¿â»Ö¸´£º´Ósql£¬´ÓÎļþ
¾ßÌåÓ÷¨:
Ê×ÏÈн¨²âÊÔÓÃÊý¾Ý¿âmytest£¬È»ºóÔÚÀïÃ潨Õűí
PHP´úÂë:
ÒÔÏÂÊÇ´úÂëƬ¶Î£º
--
-- ±íµÄ½á¹¹ `test`
--
CREATE TABLE `test` (
`id ......
<?php
//¶ÔÏó
class MyJson{
$id=1;
$site ......
×¼±¸:
lighttpd-1.4.15.tar.gz
php-4.4.2.tar.gz
mysql-5.0.20a.tar.gz
¿ªÊ¼:
1 ±àÒë°²×°lighttpd
# tar zxvf lighttpd-1.4.15.tar.gz
# cd lighttpd-1.4.15
# ls
# ./configure --prefix=/usr/local/lighttpd //´Ë²¿ÎÞ·¨±àÒëʱÌáʾ°²×°prce-devel
#&nbs ......
phpÁ¬½Ómysql²âÊÔ´úÂ룺
$link=mysql_connect('localhost','root','123456');
if(!$link) echo "ʧ°Ü!";
else echo "³É¹¦!";
mysql_close();
?>
ÔËÐдúÂë³öÏÖ£ºCall to undefined function 'mysql_connect()'… ʧ°Ü
°Ù¶ÈÕÒµ½½á¹ûÊÇPHP+MYSQL »·¾³Ã ......
ÒòΪֻÓÐiis6.0²Å´øÓÐwebÀ©Õ¹¡£¶øiis6.0ÊÇĬÈÏ°²×°ÔÚwin2003µÄ¡£winxpÊDz»ÄÜ°²×°iis6.0µÄ¡£ÄÇÎÒÃǾÍÓÃiis5.1°É¡£
»·¾³£ºWINXP+IIS5.1
¿ªÊ¼Ö®Ç°ÇëÏÈÈ·¶¨ÄãµÄIIS°²×°ÊÇ·ñ³É¹¦£¬ÄÜ·ñͨ¹ýhttp://localhost
À´
·ÃÎÊ
Ò»¡¢Ïȵ½PHP¹Ù·½ÍøÏÂÔظöphp-5.2.5-Win32.zip
£¬µã»÷ÕâÀïÁ´½Óµ½¹Ù
ÍøÏÂÔصØÖ·
¶þ¡¢ÏÂÔغÃÖ®ºó£¬Ö±½ÓÈ«²¿ ......