2011-01-09 48 views
0

我想知道工作了關鍵字的競爭任何算法或PHP代碼。關鍵字可以在每個網站和多個網站上使用多個網站。我想知道它的排名如何計算出來。關鍵字分析器

謝謝

+2

你想我們能夠建立你的搜索引擎? – dqhendricks 2011-01-09 17:29:12

+0

@dqhendricks - 「你應該明白了吧」 - 我喜歡我們如何預計爲他公頃 – sethvargo 2011-01-09 17:34:30

+0

這實際上是兩個問題,做到這一點;你可能有1個「問題」,但你需要分開不同的問題。在這裏你的第二個問題是不值得一問的一個新問題(它已經[回答](http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/ 1732454#1732454),並且很可能會很快被重複關閉)。爲此,我建議編輯這個問題並刪除第二段。 – 2011-01-09 18:26:20

回答

0

你想要一個搜索引擎?這是一項非常雄心勃勃的任務。很多人想問一個志願者驅動的PHP線程。 因爲我是一個好人,我給你的正則表達式的自由,但你必須做一些挖掘打造你想要的搜索引擎。

/<title>([^<])*</title>/gi 

如果您確實是認真對待SE,請嘗試從this article from O'Rilley開始。

0

Try get_meta_tags

例2什麼get_meta_tags()返回(從手動拍攝)

<?php 
// Assuming the above tags are at www.example.com 
$tags = get_meta_tags('http://www.example.com/'); 

// Notice how the keys are all lowercase now, and 
// how . was replaced by _ in the key. 
echo $tags['author'];  // name 
echo $tags['keywords'];  // php documentation 
echo $tags['description']; // a php manual 
echo $tags['geo_position']; // 49.33;-86.59 
?>