All right, all right, all right, I'll give it a shot.
I have never used preg_replace before, so I did not know how your code would work. Also, look, I can turn it into html quite easly with my function . . .
<?php
/* Convert the colorcodes from LFS into a html color, using the font tag.
Stand alone funcion (Requires no other function call) */
function lfs_cc2html( $str_name )
{
$arr_name = explode( '^', $str_name );
foreach( $arr_name as $key => $arr_name_part )
{
if( is_numeric( $arr_name_part{0} ) )
{
switch( $arr_name_part{0} )
{
case 1:
$arr_name[$key] = '<font color="#ff0000">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
case 2:
$arr_name[$key] = '<font color="#05fd05">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
case 3:
$arr_name[$key] = '<font color="#ffff00">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
case 4:
$arr_name[$key] = '<font color="#0000ff">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
case 5:
$arr_name[$key] = '<font color="#ff00ff">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
case 6:
$arr_name[$key] = '<font color="#00ffff">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
case 7:
$arr_name[$key] = '<font color="#ffffff">' . substr( $arr_name[$key], 1 ) . '</font>';
break;
default:
$arr_name[$key] = substr( $arr_name[$key], 1 );
break;
}
}
}
$name = implode( '', $arr_name );
return $name;
}
$tabs = "\t\t";
echo $tabs . lfs_cc2html( '^1(E^7AGL^4E)^7Dygear' ) . "<br />\n";
?>