EchoFool Posted February 10, 2008 Share Posted February 10, 2008 I have a function which i use to maintain the layout of the text block but i get an which i do not know what i have to do to correct. I have two areas on the same page using the same bb code function only i renamed the second one to avoid clashes. This is what i got for my 2 functions: 1 <?php function bbcode_format($Notes){ $Notes = htmlentities($Notes); $simple_search = array( '/\[b\](.*?)\[\/b\]/is' ); $words = array('[b]','[/b]'); $code = array('<strong>','</strong>'); $Notes= str_replace($words, $code, $Notes); echo $Notes; } ?> 2 <?php function bbcode_format($Infomation){ $Infomation = htmlentities($Infomation); $simple_search = array( '/\[b\](.*?)\[\/b\]/is' ); $simple_replace = array( '<strong>$1</strong>' ); // Do simple BBCode's $Infomation = preg_replace ($simple_search, $simple_replace, $Infomation); echo $Infomation; } ?> My error is this: Fatal error: Cannot redeclare bbcode_format() (previously declared in C:\xampp\htdocs\pendingreports.php:122) in C:\xampp\htdocs\pendingreports.php on line 161 Relating to the second function.. Link to comment https://forums.phpfreaks.com/topic/90386-bbcode-function-help/ Share on other sites More sharing options...
tibberous Posted February 10, 2008 Share Posted February 10, 2008 You have to change the function name, not the name of it's parameter. Link to comment https://forums.phpfreaks.com/topic/90386-bbcode-function-help/#findComment-463402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.