Re: preg_replace_callback(), how to pass function argument/param?

From: Date: Sun, 30 Mar 2008 18:34:06 +0000
Subject: Re: preg_replace_callback(), how to pass function argument/param?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-272316@lists.php.net to get a copy of this message
On Sun, Mar 30, 2008 at 1:17 AM, Micky Hulse <micky@ambiguism.com> wrote: > Hi, > > This is probably simple to answer for most of ya'll, but... > > preg_replace_callback($f, 'mah_processTags', $text); > > Besides the matches, how would I pass function args/param to > mah_processTags()? > > For example, I would like to do something like this: > > preg_replace_callback($f, 'mah_processTags($arg1)', $text); preg_replace_callback($f, 'mah_processTags(\'$0\', $arg1)', $text); Does this work? > function mah_processTags($matches, $arg1) { ... } > > Is this even possible? I just want to pass-in $arg1 along with the > matches. :) > > Possible? > > Many thanks in advance!!! > Cheers, > Micky > > -- > Wishlist: <http://tinyurl.com/22xonb> > Switch: <http://browsehappy.com/> > BCC?: <http://snipurl.com/w6f8> > My: <http://del.icio.us/mhulse> > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- -Casey

« previous php.general (#272316) next »