str_replace problem
Posted: Sun Jul 27, 2008 3:50 pm
The line of code below is supposed to take a paragraph and replace a particular word in that paragraph with a hyperlinked copy of that word. Everything works except that the url in the link is blank. It is defined earlier in the document and works elsewhere, just not here, so I assume I must have the syntax wrong? What am I missing?
Code: Select all
$par1=str_replace("example","<a href='$url'>$input1[$rand_key1]</a>", $par1);