this =>
http://www.firepages.org/stuff/ereg.php throws a parse error on one of the lines, but the rest appear to work??
PHP Code:
<?
$col=array(
x=>"<font color=\"#006400\">",b=>"<font color=\"#00008B\">",
c=>"<font color=\"#008B8B\">",g=>"<font color=\"#006400\">",
m=>"<font color=\"#8B008B\">",r=>"<font color=\"#8B0000\">",
w=>"<font color=\"#808080\">",y=>"<font color=\"#808000\">",
B=>"<font color=\"#0000FF\">",C=>"<font color=\"#OOFFFF\">",
G=>"<font color=\"#00FF00\">",M=>"<font color=\"#FF00FF\">",
R=>"<font color=\"#FF0000\">",W=>"<font color=\"#FFFFFF\">",
Y=>"<font color=\"#FFFF00\">",D=>"<font color=\"#636363\">");
$yaks=file('amazing.txt');
foreach($yaks as $str){
$str=eregi_replace("\{([a-z]{1})","</font>{\".\$col[\\1].\"",$str);
eval("echo \"<font color=navy>$str\";");
echo "<br />";
}
?>
lol just noticed that both the forum and the highlight_string() function strip a '\' from the code
$col[\1] should read $col[
\\1]