I am sure KLB or one of you other php gurus can help me with this. I am trying to do a string replace the catch is i do not want to replace text within an url. Here is my existing code and if anyone can help me with code that would NOT replace withing an url you will be my hero
PHP Code:
$cast = $row_cat_movie['cast'];
$st_str = trim($cast, ' '); // Trim white spaces
$strs = explode(',', $cast); // Explode into an array by delimiter
$content = $row_movie_news['desc']; //the text to apply it to.
for($i=0; $i<sizeof($strs); $i++)
{
$strs[$i] = trim($strs[$i], ' ');
$content = str_replace($strs[$i],'<a href="celeb-'.str_replace(" ", "-", $strs[$i]).'.htm"><font color="#666666">'.$strs[$i] .'</font></a>',$content);
}
echo cleanupSmartQuotes($content);
Bookmarks