ki Posted February 27, 2007 Share Posted February 27, 2007 Okay everything works except my [ code tag ] it doesnt do the highlight ;/ heres the code: $search = array('/\[b\](.*?)\[\/b\]/is', '/\[i\](.*?)\[\/i\]/is', '/\[color=(.*?)\](.*?)\[\/color\]/is', '/\[u\](.*?)\[\/u\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[code\](.*?)\[\/code\]/is', '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', '/\[flash\](.*?)\[\/flash\]/is'); $replace = array('<b>$1</b>', '<i>$1</i>', '<font color="$1">$2</font>', '<u>$1</u>', '<img src="$1" />', '<a href="$1">$1</a>', '<a href="$1">$2</a>', '<table align="center" cellpadding="1" cellspacing="1" width="98%" class="code"><tr><td valign="top">'.highlight_string(stripslashes('$1'), true).'</td></tr></table>', '<br><table align="center" cellpadding="1" cellspacing="1" width="98%" class="quote"><tr><td><b>$1 said...</b></td></tr><tr><td>$2</tr></td></table><br>', '<object width="425" height="350"><param name="movie" value="$1"></param><param name="wmode" value="transparent"></param><embed src="$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'); $var = preg_replace ($search, $replace, $var); Link to comment https://forums.phpfreaks.com/topic/40408-bbcode-help/ Share on other sites More sharing options...
fert Posted February 27, 2007 Share Posted February 27, 2007 http://www.phpfreaks.com/forums/index.php/topic,86802.0.html Link to comment https://forums.phpfreaks.com/topic/40408-bbcode-help/#findComment-195537 Share on other sites More sharing options...
ki Posted February 27, 2007 Author Share Posted February 27, 2007 thanks Link to comment https://forums.phpfreaks.com/topic/40408-bbcode-help/#findComment-195541 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.