This is the PHP source code to qii.sf.net.
To view the source to this source viewer, go here.
<?
// This stuff is ripped from php.net.
function highlight_php($code, $return = FALSE)
{
// Using OB, as highlight_string() only supports
// returning the result from 4.2.0
ob_start();
highlight_string($code);
$highlighted = ob_get_contents();
ob_end_clean();
// Fix output to use CSS classes and wrap well
$highlighted = '<div class="phpcode">' . str_replace(
array(
' ',
'<br />',
'<font color="', // for PHP 4
'</font>',
"\n ",
' '
),
array(
' ',
"<br />\n",
'<font color="',
'</font>',
"\n ",
' '
),
$highlighted
) . '</div>';
if ($return) { return $highlighted; }
else { echo $highlighted; }
}
?>
<html><head><title>qii.sf.net PHP Source</title></head><body>
This is the PHP source code to <a href="http://qii.sf.net">qii.sf.net</a>.<br>
To view the source to this source viewer, go <a href="source.php?self=yes">here</a>.<br>
<?
if ( $_GET["self"] == "yes" ) { echo highlight_php(join("", file("source.php"))); }
else { echo highlight_php(join("", file("index.php"))); }
?></body></html>