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); Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
ki Posted February 27, 2007 Author Share Posted February 27, 2007 thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.