Re: callback function via preg_replace_callback

From: Date: Mon, 09 Jun 2003 03:52:40 +0000
Subject: Re: callback function via preg_replace_callback
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150697@lists.php.net to get a copy of this message
On Sun, 08 Jun 2003 16:25:19 -0400, you wrote: >I have Function A containing a preg_replace_callback calling Function B. >The code works quite nicely. > >Now, is there a way for the callback function (B) to receive *additional* >arguments >(from A), so that, for example, it may optionally perform additional tasks? >If not, is there a way for B to otherwise access arguments passed to A, for >the same purpose? I'm pretty sure it's not possible, and I've asked similar questions before. You could try generating the callback function /within/ A, using PHP's equivalent of lambda functions: http://www.php.net/manual/en/function.create-function.php

« previous php.general (#150697) next »