note 71528 added to function.preg-replace

From: Date: Mon, 04 Dec 2006 15:29:39 +0000
Subject: note 71528 added to function.preg-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-120269@lists.php.net to get a copy of this message
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?.. ---- Server IP: 66.163.161.117 Probable Submitter: 65.123.132.14 ---- Manual Page -- http://www.php.net/manual/en/function.preg-replace.php Edit -- https://master.php.net/note/edit/71528 Del: integrated -- https://master.php.net/note/delete/71528/integrated Del: useless -- https://master.php.net/note/delete/71528/useless Del: bad code -- https://master.php.net/note/delete/71528/bad+code Del: spam -- https://master.php.net/note/delete/71528/spam Del: non-english -- https://master.php.net/note/delete/71528/non-english Del: in docs -- https://master.php.net/note/delete/71528/in+docs Del: other reasons-- https://master.php.net/note/delete/71528 Reject -- https://master.php.net/note/reject/71528 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#120269) next »