note 71528 rejected from function.preg-replace by nlopess
| From: | nlopess@php.net | Date: | Mon, 04 Dec 2006 18:49:12 +0000 |
| Subject: | note 71528 rejected from function.preg-replace by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120277@lists.php.net to get a copy of this message | ||
Note Submitter: fatherstorm at fatherstorm dot com
----
Call me lost. I'm trying to parse input text sort of like BBCode, but I need to hand off the
results of my match to a function to return it correctly for output. Problem is, as far as I can
tell, my matches come back only in variables that will not work outside of the PREG function?
$str= preg_replace ('/\[[wW]impy\](.*?)\[\/[wW]impy\]/is', makeWimpyPlayer($1), $str);
This won't work because $1 is not a valid variable name as far as PHP is concerned, but
perfectly valid within the framework of the PREG_REPLACE function itself?..