note 69007 deleted from function.preg-replace by colder

From: Date: Mon, 18 Jun 2007 20:02:39 +0000
Subject: note 69007 deleted from function.preg-replace by colder
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-127701@lists.php.net to get a copy of this message
Note Submitter: Sevendust at aaoclan dot be ---- <?php // BBCode parser by Sevendust Class BBParse { Var $InputString; Var $OutputString; Function BBParse ( $InputString, $OutputString ) { If ( $This -> Input == '' ) { return_error ( 'You have to provide at least a message of 20 characters!', true ); } else { // Define some default BB code tags, such as bold, italic, and url. $BBCode[0] = '/[b]/'; $BBCode[1] = '/[/b]/'; $BBCode[2] = '/[i]/'; $BBCode[3] = '/[/i]/'; $BBCode[4] = '/[url]/'; $BBCode[5] = '/[/url]/'; // Replacement strings, in HTML ofcourse. $BBReplace[0] = '<b>'; $BBReplace[1] = '</b>'; $BBReplace[2] = '<i>'; $BBReplace[3] = '</i>'; $BBReplace[4] = '<a href=' . $InputString . '>'; $BBReplace[5] = '</a>'; $BBParsedOutput = Preg_Replace ( $BBCode, $BBReplace, $InputString ); } } } ?>

« previous php.notes (#127701) next »