$repl = array('## #'=>'<dt>','##'=>"</dt>\r\n<dd>",'##'=>'</dd>');
Single quotes don't do any interpolation. Use double-quotes, and the newline / carriage return controls will get interpolated.
Great thanks a lot :)
Hmmm sorry that didn't work. I have uploaded the code to a text file as I think some of my code encoded.
Yeah, the forum ate my backslash originally. You need to use baclslash-n
\n and backslash-r
I edited my original reply. Sorry about that.
$repl = array('#<li>#'=>'<dt>','#</a>#'=>"</a></dt>\r\n<dd>",'#</li>#'=>'</dd>');
$output .= "<dl id='linklist' class='linkage'>\r\n" . preg_replace(array_keys($repl), array_values($repl), $ret) . '</dl>';
You can use the opposite kind of quote mark inside the other without backslash escaping them. So inside of single quotes, you can freely use double-quotes (though the outer single quotes will still suppress interpolation). You can use single quotes inside of doublequotes, and interpolation will still work.
Ah sweet, that did the trick.
Call me Mr. Picky but I like to see code as it was intended :)
This topic has been closed to new replies.