Easy function that shows the PHP-Source Code of the page with syntax high lighting. Might be quite useful just copy it to you page and call it when you want to show you code:
echo '<p> This is the code php file: </ p>'; $page = highlight_file($_SERVER [ 'SCRIPT_FILENAME'], TRUE); $page = str_replace ( array ( '<code>', '/ code>', '','</ are >','< font color ="'), array ( '<pre style="padding:1em;border:2px solid black;overflow:scroll">', '/ pre>', '','</ span >','< span style = "color:' ), $page); echo $page; echo '<a <p> href="',$_SERVER['PHP_SELF'],'"> Back </ a> </ p>'; echo '</ body> </ html>'; exit;
Advertisements
Leave a Reply