Tomer
08-10-2005, 07:49 PM
Look guys, I have this small problem with this PHP code, anyone know how to get it working?
$body = preg_replace("~\<code\>(.*?)\<\/code\>~is", "<div class='code'>". showsource(" .\\1. ") . "</div>", $row[body]);
Basically, I want this line to: Find all text within the code tags, and execute that function [showsource()] on the text, and place it inside the div. It's not working properly.
Best way to explain in is via example:
Before = "text1 <code>text2</code> text3";
After = "text1 <div class="code>" . showsource('text2') . "</div> text3";
Thanks
$body = preg_replace("~\<code\>(.*?)\<\/code\>~is", "<div class='code'>". showsource(" .\\1. ") . "</div>", $row[body]);
Basically, I want this line to: Find all text within the code tags, and execute that function [showsource()] on the text, and place it inside the div. It's not working properly.
Best way to explain in is via example:
Before = "text1 <code>text2</code> text3";
After = "text1 <div class="code>" . showsource('text2') . "</div> text3";
Thanks
