note 79208 added to function.preg-replace-callback

From: Date: Thu, 15 Nov 2007 18:09:50 +0000
Subject: note 79208 added to function.preg-replace-callback
Groups: php.notes 
Request: Send a blank email to php-notes+get-132309@lists.php.net to get a copy of this message
to highlight a code between bbcode tags like [php] and [/php] with the class geshi.. <?php $code = '[php1]echo "Hello World!";[/php1]'; echo preg_replace_callback('/\[php\](.*)\[\/php\]/s',"geshi",$code); function geshi($matches) { // include geshi $geshi = include_once("geshi/geshi.php"); $geshi = new GeSHi($matches[1],"php"); // to enable line numbers //$geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS); return $geshi->parse_code(); } ?> to download geshi go to http://qbnz.com/highlighter/downloads.php ---- Server IP: 69.147.83.197 Probable Submitter: 212.76.64.1 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace-callback.php Edit -- https://master.php.net/note/edit/79208 Del: integrated -- https://master.php.net/note/delete/79208/integrated Del: useless -- https://master.php.net/note/delete/79208/useless Del: bad code -- https://master.php.net/note/delete/79208/bad+code Del: spam -- https://master.php.net/note/delete/79208/spam Del: non-english -- https://master.php.net/note/delete/79208/non-english Del: in docs -- https://master.php.net/note/delete/79208/in+docs Del: other reasons-- https://master.php.net/note/delete/79208 Reject -- https://master.php.net/note/reject/79208 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132309) next »