imarockstar Posted October 12, 2009 Share Posted October 12, 2009 I am outputting some pho code .. and I want to display the source code so people can copy and paste it .... not really wanting to use a TEXTAREA box .... any ideas ? Link to comment https://forums.phpfreaks.com/topic/177462-how-can-i-display-php-source-code-snippets/ Share on other sites More sharing options...
mikesta707 Posted October 12, 2009 Share Posted October 12, 2009 use html entities Link to comment https://forums.phpfreaks.com/topic/177462-how-can-i-display-php-source-code-snippets/#findComment-935704 Share on other sites More sharing options...
PFMaBiSmAd Posted October 12, 2009 Share Posted October 12, 2009 Or php's highlight_ functions - <?php $file = 'help.php'; // name of file containing php code $content = highlight_file($file,true); // get and highlight the php code ?> <style type="text/css"> .code { border-style:solid; border-color:red; } </style> <?php echo '<div class="code">' . $content . '</div>'; ?> Link to comment https://forums.phpfreaks.com/topic/177462-how-can-i-display-php-source-code-snippets/#findComment-935712 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.