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