;
GO //キーワードとソース検索エンジン名を取得します
$search_url = isset($_GET['url '] )?$_GET['url']:''; // 受信アドレスを表します
/*$search_url = urldecode($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(
" ドメイン" => "yahoo.com"、
"kw" => "q"、
"charset" => "utf-8"
)、
"s7"=>array(
"ドメイン" => "bing.com",
"kw" => "q",
"charset" => "utf-8"
),
"s8"=>array(
"domain" = > "sogou.com",
"kw" => "クエリ",
"charset" => "gbk"
),
"s9"=>array(
"domain" => "youdao. com",
"kw" => "q",
"charset" => "utf-8"
),
);
//機能: URL からキーワードを抽出します。パラメータの説明: URL とキーワードの前の文字。
関数 get_keyword($url,$kw_start)
{
$start = ストリップス($url,$kw_start)
$url = substr($url,$start+strlen($kw_start)); ($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();
$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;
}
}
エコー "
" print_r($arr_key)>
http://www.bkjia.com/PHPjc/322937.html www.bkjia.com 本当