to their corresponding HTML entities. $contents = htmlspecialchars($contents); // Turns URLs into links; but ignore "href" when this page is processing itself. if ($page != 'viewcode') { $url_regex_pattern = '/(href|src|og:image"\scontent|og:url"\scontent)="([^#].+?)"/'; } else { $url_regex_pattern = '/(src|og:image"\scontent|og:url"\scontent)="([^#].+?)"/'; } $contents = preg_replace($url_regex_pattern, '$1="$2"', $contents); // Turns my PHP includes into links. if ($lang == 'php') { $contents = preg_replace('/include\(\'(.+?)\.php/', 'include(\'$1.php', $contents); } // Outputs the result, with the prettify language specified if necessary. echo "\n", '
' , $contents;
// Outputs the box in the lower left, unless this pages is processing itself.
//if ($page != 'viewcode') { echo 'Curious about how this page works?'; }
// Close the pre element.
echo '', "\n";
include('end.php');
?>