note 34703 added to function.highlight-string

From: Date: Mon, 04 Aug 2003 18:15:35 +0000
Subject: note 34703 added to function.highlight-string
Groups: php.notes 
Request: Send a blank email to php-notes+get-53339@lists.php.net to get a copy of this message
This is a werry simple example of a non-database posting of highlighting code. /* * Save this to codes.php and start posting! * the codes will be saved into codes.php.snipplets * if some spamers do something you will need to edit the * codes.php.snipplets in notepad. Sorry for the bad english ;-) */ <? if ($code) { $code = ereg_replace( "\r\n\r\n", "\n", $code); $code = "$code"; $fp = fopen (basename($PHP_SELF) . ".snipplets", "a"); fwrite ($fp, highlight_string($code,1)); fwrite ($fp, ("<hr>")); fclose ($fp); } @readfile(basename(($PHP_SELF . ".snipplets"))); ?> <FORM method="post"> <b>Your code:</b><BR><TEXTAREA name="code" rows=10 cols=50 wrap=virtual> </TEXTAREA><BR> <INPUT name="submit" type="submit" value="Submit"> </FORM> ---- Manual Page -- http://www.php.net/manual/en/function.highlight-string.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34703 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34703&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34703&report=yes

« previous php.notes (#53339) next »