2011-01-09 53 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 
?>