Add a linked solution to keywords in text

111 3

Often on the internet to read the technology blog, it's found that written blog isn't only high quality, but also excellent text layout. Blogs often have links to keywords, such as linux links to linux that add a wiki to the ipad and add an apple online ipad page to it. What solutions do you generally use for this kind of effect. My own idea is to first do a hash of the keyword, key to value, then search for the full text of the blog, find the key, replace the value. Do you want to do this. Or there's a better solution, or something like can be used directly. Please advise each other. Thank you.

4 Answers

82 2
Replace ideas

Create a keyword list

$keywords = array(
 array('apple', 'http://www.apple.com/'),
 array('iphone', 'http://www.apple.com/iphone/'),
 array('ipad', 'http://www.apple.com/ipad/'),
);

Search blog full text search page, replace the search with the str_replace() to replace the <a href="http://www.sample.com">keyword</a> Replace method

1, program background automatically processed when the article is output
2, the program outputs only the list of keywords that are appropriate, replacing the javascript

147 4
Replace ideas

Create a keyword list

$keywords = array(
 array('apple', 'http://www.apple.com/'),
 array('iphone', 'http://www.apple.com/iphone/'),
 array('ipad', 'http://www.apple.com/ipad/'),
);

Search blog full text search page, replace the search with the str_replace() to replace the <a href="http://www.sample.com">keyword</a> Replace method

1, program background automatically processed when the article is output
2, the program outputs only the list of keywords that are appropriate, replacing the javascript

142 2

You can use services similar to the http://www.apture.com/web site. Intelligent recognition, depending on the content source chosen.

147 4

You can use services similar to the http://www.apture.com/web site. Intelligent recognition, depending on the content source chosen.

138 5

You're just like this, the search results highlight, you can refer to http://search.haohaoup.com/?q=%E5%8D%...
The key question is how you find these keywords.
You can use the word segmentation technology to find these keywords and then wrap them.

115 3

You're just like this, the search results highlight, you can refer to http://search.haohaoup.com/?q=%E5%8D%...
The key question is how you find these keywords.
You can use the word segmentation technology to find these keywords and then wrap them.

...