ki Posted February 22, 2007 Share Posted February 22, 2007 Can someone tell me whats wrong with this script? The only thing that errors is my code BBCode. ERROR: Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/tragical/public_html/index.php on line 54 CODE: function bbcode_format($var) { $var = str_replace('<','<',$var); $var = str_replace('>','>',$var); $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" width="12" class="code_Side"><img src="images/code.png"></td><td valign="top">'.highlight_string($1).'</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); return $var; } Quote Link to comment Share on other sites More sharing options...
ki Posted February 23, 2007 Author Share Posted February 23, 2007 err any help? ??? 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.