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
Ïà¹ØÎĵµ£º
ÖªµÀ²î¾àÁË£¬Å¬Á¦°É£¡
1. Which of the following will not add john to the users array?
1. $users[] = 'john';
2. array_add($users,'john');
3. array_push($users,'john');
4. $users ||= 'john';
2. What's the difference between sort(), asort() and ksort? Under what circumstances would you use each o ......
±ÈÈçÒª¸øÓû§±¨¸æÒ»¸ö´íÎó£¬ÓÃÏÂÃæµÄ·½·¨£º
ʹÓÃset_error_handlerÉèÖÃ×Ô¼ºµÄ´íÎó´¦Àíº¯Êý£¬ÔÚ±¨´íµÄµØ·½Ê¹ÓÃtrigger_error£¬ÔÚ×Ô¶¨ÒåµÄ´íÎó´¦Àíº¯ÊýÖиøÓû§ÏÔʾһ¸ö³ö´íÐÅÏ¢Ò³Ãæ¡£
µ«
ÊÇÈç¹ûµ÷ÓÃtrigger_errorµÄÕâ¸öÒ³ÃæÊDZ»Ò»´ÎajaxÇëÇó´¥·¢µÄ£¬ÄÇôajax·µ»Øºó½«µÃµ½Ò»´ó¶ÑÓÃÓÚÏÔʾ´íÎóµÄhtml´úÂë¡£¶øÒ»°ã
ajaxµ÷Óö ......
²éÕÒmysql_pconnectʱÔÚmysql°ïÖúÎĵµÉÏ·¢Ïֵģ¬¼ÇÔÚÕâÀï¡£
web serverʹÓÃphpÉú³ÉÒ»¸öwebÒ³ÃæµÄÈýʽÓÐÒÔÏÂÈýÖÖ£º
Ò»£º°ÑPHP×÷ΪCGI Wrapper¡£ÕâÖÖ·½Ê½Ï£¬Ã¿¸öµ½´ïweb serverµÄÇëÇ󶼻ᵼÖÂÒ»¸öphp½âÎöÆ÷½ø³Ì±»´´½¨£¬µ±Õâ¸öphpÒ³ÃæÖ´ÐнáÊøʱ£¬Õâ¸öphp½âÎöÆ÷½ø³ÌÖÕÖ¹¡£
¶þ£º
ÔÚ¶à½ø³ÌµÄweb serverÖУ¬°Ñphp×÷Ϊweb
se ......
<?php
function delfile($dir,$n) //ɾ³ýDIR·¾¶ÏÂNÌìÇ°´´½¨µÄËùÓÐÎļþ;
{
if(is_dir($dir))
{
if($dh=opendir($dir))
{
while (false !== ($file = readdir($dh)))
{
if($file!="." && $file!="..")
{
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)) ......
ÉèÖÃÊý¾Ý¿âÁ¬½Ó
<?php
/**
* @author [˹ÈË]
* @date 2010/6/1/10:16
* @
*
*/
define("RDFAPI_INCLUDE_DIR", "E:/siren/rdfapi-php/api/");
include(RDFAPI_INCLUDE_DIR . "RDFAPI.php");
//Á¬½Óµ½MSAccessÊý¾Ý¿â£¨rdf_db DSN£©µÄʹÓÃÁ¬½ÓÉèÖÃ
......