Add Some Links to some words issue
<p>I have some words Such as</p>

<p>"Hello this article about games. Our choice is train games. Name of game is My Little Train"</p>

<p>I want to add automatic links as below</p>

<p><strong>"games" » "<a href="http://www.mywebsite.com" rel="nofollow">http://www.mywebsite.com</a>"</strong></p>

<p><strong>"train games" » "<a href="http://www.myothersiteadrwesss.com" rel="nofollow">http://www.myothersiteadrwesss.com</a>"</strong></p>

<p><strong>"game" » "<a href="http://www.my3thsiteadress.com" rel="nofollow">http://www.my3thsiteadress.com</a>"</strong></p>

<p>I tried it with PHP and <code>str_replace</code> but after my codes</p>

<p>"games" word has 2 links nested  ("<a href="http://www.mywebsite.com" rel="nofollow">http://www.mywebsite.com</a>" and "<a href="http://www.my3thsiteadress.com" rel="nofollow">http://www.my3thsiteadress.com</a>" )</p>

<p>"train games" word has 3 links nested (all 3 links)</p>

<p>How can I solve my problem?</p>

<p>finally i want</p>

<pre><code>&lt;a href="http://www.my3thsiteadress.com"&gt;game&lt;/a&gt;
&lt;a href="http://www.myothersiteadrwesss.com"&gt;train games&lt;/a&gt;
&lt;a href="http://www.mywebsite.com"&gt;games&lt;/a&gt;
</code></pre>

<p>words count can be change</p>
