achoo254 |
01-24-2013 12:11 PM |
I've done outside tags, but i don't know using random tags, here my code:
Code:
$content = "<span style="color:black;">hello word</span>, this is my <span style="color:black;">code!</span>...and nice to meet everyone!";
$find = array('#>([^<>]+)<([^/]{1,1})#');
$replace = array(
'><span style="color:red;">$1</span><$2',
'><span style="color:blue;">$1</span><$2',
'><span style="color:white;">$1</span><$2');
$content = preg_replace($find, $replace, $content);
Result:
Quote:
<span style="color:black;">hello word</span><span style="color:red;">, this is my </span><span style="color:black;">code!</span><span style="color:red;">...and nice to meet everyone!</span>
|
So how to fix it , please help ! :(
--------------- Added [DATE]1359091756[/DATE] at [TIME]1359091756[/TIME] ---------------
i tried preg_replace to preg_replace_callback but don't work , please anyone help me! :(
|