hi.
<?php
is the correct way to open php code,
unless you would like possibly later get problems with your scripts
To your question.
Use this function [man]highlight_string[/man]
There is also one highlight_file() function
that can take any php page file and display it as colored code.
Try this
<?php
$php_str = '<?php echo "For example I enclosed this in the PHP tags before submitting to the database"; ?>';
highlight_string( $php_str ); // will echo directly
echo '<br><hr>';
echo '<br><br>';
// will put the highlighted colored html source in a variable
// for later display
$html_output_code = highlight_string( $php_str, true );
echo $html_output_code;
echo '<br>';
// we can show the HTML source coode of this
echo htmlentities( $html_output_code );
?>