High Brightness display PHP source code function Heighphpcode ($Heightstring) {
do{
$z = 0;
if (Preg_match ('/ (.*?) /s ', $Heightstring, $reg)) {
$z = 1;
$code = ";
Ob_start ();
Highlight_string ($reg [1]);
$code = Ob_get_contents ();
Ob_end_clean ();
$reg [1] = Addslashes ($reg [1]);
$Heightstring =preg_replace ("/ (.*?) /S "," $code ", $Heightstring, 1);
}
}while ($Z);
return $Heightstring;
}
##########################################################################################
# $PHPcode is the code to be highlighted
$PHPcode = <<
function Heighphpcode ($Heightstring) {
do{
$z = 0;
if (Preg_match ('/ (. *?) /s ', $Heightstring, $reg)) {
$z = 1;
$code = ";
Ob_start ();
Highlight_string ($reg [1]);
$code = Ob_get_contents ();
Ob_end_clean ();
$reg [1] = Addslashes ($reg [1]);
$Heightstring =preg_replace ("/ (. *?) /S "," $code ", $Heightstring, 1);
}
}while ($Z);
return $Heightstring;
}
END;
##########################################################################################
Echo Heighphpcode ("$PHPcode");
?>
http://www.bkjia.com/PHPjc/314804.html www.bkjia.com true http://www.bkjia.com/PHPjc/314804.html techarticle High Brightness display PHP source code? PHP function Heighphpcode ($Heightstring) {do{$z =0; if (Preg_match ('/phpcode (. *?) /phpcode/s ', $Heightstring, $reg) {$z =1; $code = '; Ob_start (); Hig ...