title: search a string for a word and replace that word with different links php
body: <p>Using PHP, how can i replace a word in a string with different links.</p>
  
  <p>I want to replace the word web development with different links in order</p>
  
  <blockquote>
    <p>This web development company is great. A good web development starts
    with...</p>
  </blockquote>
  
  <p>like so</p>
  
  <blockquote>
    <p>This <a href="http://www.google.com/">web development</a> company is great. A good <a href="http://yahoo.com">web development</a> starts
    with...</p>
  </blockquote>
  
  <p>i have tried using <code>str_ireplace</code> but then both links lead to the same site.</p>
  
  <p>Here is my code</p>
  
  <pre><code>&lt;?php
  
  $text = 'This web development company is great. A good web development starts with...';
  
  
  $replaced = str_ireplace(array('web development', 'web development'),array('&lt;a href="http://google.com"&gt;web development&lt;/a&gt;', '&lt;a href="http://yahoo.com"&gt;web development&lt;/a&gt;'), $text);
  
  echo $replaced;
  </code></pre>