note 83088 added to function.highlight-file

From: Date: Fri, 09 May 2008 13:06:02 +0000
Subject: note 83088 added to function.highlight-file
Groups: php.notes 
Request: Send a blank email to php-notes+get-139214@lists.php.net to get a copy of this message
You can trick this function to apply additional css rules to parts of the source code. For example, if you wanted comments to appear in bold you could do the following <?php ini_set('highlight.comment', '#CCCCCC; font-weight: bold;'); highlight_file('file.php'); ?> This works because when highlight_file() writes out a comment it wraps it in <span style="color: {contents of hightlight.comment ini variable}">...</span>. Therefore as long as your ini value for highlight.comment starts with a color, you can put in whatever style declarations you like. This applies to all of the other relavent ini values: highlight.default, highlight.html, highlight.keyword, highlight.string. ---- Server IP: 92.48.74.199 Probable Submitter: 129.67.136.229 ---- Manual Page -- http://www.php.net/manual/en/function.highlight-file.php Edit -- https://master.php.net/note/edit/83088 Del: integrated -- https://master.php.net/note/delete/83088/integrated Del: useless -- https://master.php.net/note/delete/83088/useless Del: bad code -- https://master.php.net/note/delete/83088/bad+code Del: spam -- https://master.php.net/note/delete/83088/spam Del: non-english -- https://master.php.net/note/delete/83088/non-english Del: in docs -- https://master.php.net/note/delete/83088/in+docs Del: other reasons-- https://master.php.net/note/delete/83088 Reject -- https://master.php.net/note/reject/83088 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139214) next »