Hello all. I'm working on the following replacement routine in my PHP Include end (no, I'm not allowed to hack the bbcodeparser)
I'm getting this error
Parse error: parse error, expecting `'('' in /web/boards/includes/functions.php(1932) : eval()'d code(36) : regexp code on line 1
Fatal error: Failed evaluating code: str_ireplace(Array, Array, 'WBURG'); in /web/boards/includes/functions.php(1932) : eval()'d code on line 36
here's the code
PHP Code:
//################ Do Mana Cost tag ######################
// Valid Characters to search for
$mana_find = array( 'w','u','b','r','g','t','x','y','z','1','2','3','4','5','6','7','8','9','0');
// Replacement Strings to insert
$mana_replace = array(
'<img src="http://www.wizards.com/images/symbols/Symbol_W_mana.gif" border="0" alt="W" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_U_mana.gif" border="0" alt="U" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_B_mana.gif" border="0" alt="B" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_R_mana.gif" border="0" alt="R" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_G_mana.gif" border="0" alt="G" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_T_mana.gif" border="0" alt="T" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_X_mana.gif" border="0" alt="X" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_Y_mana.gif" border="0" alt="Y" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_Z_mana.gif" border="0" alt="Z" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_1_mana.gif" border="0" alt="1" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_2_mana.gif" border="0" alt="2" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_3_mana.gif" border="0" alt="3" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_4_mana.gif" border="0" alt="4" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_5_mana.gif" border="0" alt="5" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_6_mana.gif" border="0" alt="6" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_7_mana.gif" border="0" alt="7" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_8_mana.gif" border="0" alt="8" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_9_mana.gif" border="0" alt="9" />',
'<img src="http://www.wizards.com/images/symbols/Symbol_0_mana.gif" border="0" alt="0" />'
);
// Now for the fun part - first we define our tag.
$manastring_find = '#\[mctwo\](.*)\[/mctwo\](<br />|<br>)??#esiU';
// Now we define our replacement
$manastring_replace = "str_ireplace($mana_find, $mana_replace, '\\1');";
// Cross our fingers.
$output = preg_replace($manastring_find, $manastring_replace, $output);