Forum Moderators: coopster
[edited by: phranque at 5:10 am (utc) on Jul 23, 2013]
[edit reason] disabled graphic smileys [/edit]
function fixLoA($content) {
$lines = explode("\n",str_replace('<br />',"\n", str_replace('<br>',"\n",$content)));
for ($i = 0; $i < count($lines); $i++) {
$lines[$i] = str_replace('? ',"? \n",$lines[$i]);
$lines[$i] = str_replace('. ',". \n",$lines[$i]);
$lines[$i] = preg_replace_callback(
//"#\<b\>(s+|.*LoA.*|s+)(\n|<br>)#s",
//"/^<b>(?=.*)(.*LoA.*)(?=.*)<br>$/",
'/[<b>|<b>|<b><i>].*LoA.*<\/b>.*(<br>|<br \/>|<\/i>|\n)/',
create_function(
'$matches',
'return "<div class=\"xxx\" style=\"color: RED\">".$matches[0]."</div>";'
),
$lines[$i]
);
}
return implode("\n",$lines);
} [<b>|<b>|<b><i>]
Certain items that may appear in patterns are more efficient than others. It is more efficient to use a character class like [aeiou] than a set of alternatives such as (a|e|i|o|u).