»ñÈ¡¹Ø¼ü´Ê¼°ËùÊôÀ´Ô´ËÑË÷ÒýÇæÃû³Æ
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>greengnn codes</title> </head> <body> <form action="index.php" method="get"> <input name="url" size="80"><button type="submit">GO</button> </form> <?php //»ñÈ¡¹Ø¼ü´Ê¼°ËùÊôÀ´Ô´ËÑË÷ÒýÇæÃû³Æ $search_url = isset($_GET['url'])?$_GET['url']:''; //´ú±í´«ÈëµÄµØÖ· /*$search_url = urldecode($search_url); print_r($search_url); */ $config = array( "s1"=>array( "domain" => "google.com", "kw" => "q", "charset" => "utf-8" ), "s3"=>array( "domain" => "google.cn", "kw" => "q", "charset" => "utf-8" ), "s4"=>array( "domain" => "baidu.com", "kw" => "wd", "charset" => "gbk" ), "s5"=>array( "domain" => "soso.com", "kw" => "q", "charset" => "utf-8" ), "s6"=>array( "domain" => "yahoo.com", "kw" => "q", "charset" => "utf-8" ), "s7"=>array( "domain" => "bing.com", "kw" => "q", "charset" => "utf-8" ), "s8"=>array( "domain" => "sogou.com", "kw" => "query", "charset" => "gbk" ), "s9"=>array( "domain" => "youdao.com", "kw" => "q", "charset" => "utf-8" ), ); //º¯Êý×÷Ó㺴ÓurlÖÐÌáÈ¡¹Ø¼ü´Ê¡£²ÎÊý˵Ã÷£ºurl¼°¹Ø¼ü´ÊÇ°µÄ×Ö·û¡£ function get_keyword($url,$kw_start) { $start = stripos($url,$kw_start); $url = substr($url,$start+strlen($kw_start)); $start = stripos($url,'&'); if ($start>0) { $start=stripos($url,'&'); $s_s_keyword=substr($url,0,$start); } else { $s_s_keyword=substr($url,0); } return $s_s_keyword; } $arr_key = array(); foreach($config as $item){ $sh = preg_match("/\b{$item['domain']}\b/",$search_url); if($sh){ $query = $item['kw']."="; $s_s_keyword = get_keyword($search_url,$query); $F_Skey=urldecode($s_s_keyword); if($item['charset']=="utf-8"){ $F_Skey=iconv( "UTF-8","gb2312//IGNORE",$F_Skey); //×îÖÕÌáÈ¡µÄ¹Ø¼ü´Ê } $keys = explode(" ",$F_Skey); $arr_key[$item['domain']] = $keys; } } echo "<pre>"; print_r($arr_key);
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ