Ars Informatica
September 28, 2020
Health Care Informatics
Web-based MySQL/PHP Databasing
Web Development
Favourite Software
Hardware for the Frugal Fanatic
Graphic Design and Image Processing
Free Scripts and Software
About Us
Contact Us

 Article Feed for this site

PHP micro-script displays PHP, HTML, Javascript code without parsing

May 6, 2006

It's almost embarrassing to release code this miniscule, but I haven't found anything similar anywhere else on the 'Net. It displays PHP, HTML, Javascript and other source code direct from file, unparsed, and presents it cleanly and professionally. An image link brands the displayed code, and refers viewers back to the main site.

To use, call source.php with the name of the file to display, i.e.


Code can be saved directly, or copied and pasted, without problems.

Complete functionality derives from one simple PHP function - htmlentities():

echo '<pre 

The htmlentities() function converts all PHP, HTML and other tags to non-coding, display-only character codes, without parsing. Too easy.

This PHP script is released under the terms of the GNU General Public License, i.e. free for you to use, modify, and even redistribute under the terms of this license - see for further details.

Full source.php code is presented here by source.php itself (in an odd sort of homage to PHP - the acronym is self-referential). More on PHP and the htmlentities() function at

download icondownload -
PHP code and documentation

Copyright © 2020 Ars Informatica. All Rights Reserved.