views:

22

answers:

1

Anybody can provide code snippet how to implement something like "SEO Smart Links" does ?

Here is what it does: SEO Smart Links can automatically link keywords and phrases in your posts and comments with corresponding posts, pages, categories and tags on your blog.

So e.g. I will provide array of keywords + links, pass it to the function and function must search for those words in post and then replace them and create links.

A: 

preg_replace (click on the link to RTFM) can give you what you are looking for. This is a PHP function that takes a string, looks for any given string in that string, and replaces it with another string. It has full regular expression support.

samiam