note 69489 added to function.highlight-string

From: Date: Thu, 07 Sep 2006 14:33:39 +0000
Subject: note 69489 added to function.highlight-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-116831@lists.php.net to get a copy of this message
I have made a quick PHP function to automatically add a php starting tag to codesnippets if it doesn't already have one. <?php $source_explode = explode("\n", $source); if (strpos($source_explode[0], '<?php') === false) { $source = "<?php " . $source; } return str_replace(array("Ä","¶","&nbsp;","?&gt;", "&lt;?php"), array("A",""," ","", ""), highlight_string($source, TRUE)); ?> ---- Server IP: 64.71.164.2 Probable Submitter: 209.198.138.155 ---- Manual Page -- http://www.php.net/manual/en/function.highlight-string.php Edit -- https://master.php.net/note/edit/69489 Del: integrated -- https://master.php.net/note/delete/69489/integrated Del: useless -- https://master.php.net/note/delete/69489/useless Del: bad code -- https://master.php.net/note/delete/69489/bad+code Del: spam -- https://master.php.net/note/delete/69489/spam Del: non-english -- https://master.php.net/note/delete/69489/non-english Del: in docs -- https://master.php.net/note/delete/69489/in+docs Del: other reasons-- https://master.php.net/note/delete/69489 Reject -- https://master.php.net/note/reject/69489 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#116831) next »