puedes usar el FCKEDITOR
para poder editar el contenido php es facil de implementar o utilizar un lector de codigo
o este funcion te servirar para ahcerlo como lo hace la pagina oficial de php
Código PHP:
<?
function ColoreaCodigo($texto) {
$texto = str_replace("
", "", $texto);
$texto = str_replace("
", "", $texto);
$texto = str_replace(">", ">", $texto);
$texto = str_replace("<", "<", $texto);
$texto = str_replace("&", "&", $texto);
$texto = str_replace('$', '\$', $texto);
$texto = str_replace('n', '\n', $texto);
$texto = str_replace('r', '\r', $texto);
$texto = str_replace('t', '\t', $texto);
$texto = str_replace('"', '"', $texto);
$texto = stripslashes($texto);
ob_start();
$nivelviejo=error_reporting(0);
highlight_string($texto);
error_reporting($nivelviejo);
$buffer = ob_get_contents();
ob_end_clean();
if ($variable) {
$abrirpost = strpos($buffer,'<?');
$cerrarpost = strrpos($buffer, '?');
$buffer=substr($buffer, 0, $abrirpost).substr($buffer, $abrirpost+5, $cerrarpost-($abrirpost+5)).substr($buffer, $cerrarpost+5);
}
$buffer=str_replace("","",$buffer);
$buffer=str_replace("","",$buffer);
return $buffer;
}
?>