Re: [PHP] preg_replace_callback(), how to pass function argument/param?
- From: heavyccasey@xxxxxxxxx (Casey)
- Date: Sun, 30 Mar 2008 11:34:06 -0700
On Sun, Mar 30, 2008 at 1:17 AM, Micky Hulse <micky@xxxxxxxxxxxxx> wrote:
Hi,preg_replace_callback($f, 'mah_processTags(\'$0\', $arg1)', $text);
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);
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
.
- Follow-Ups:
- References:
- preg_replace_callback(), how to pass function argument/param?
- From: Micky Hulse
- preg_replace_callback(), how to pass function argument/param?
- Prev by Date: Re: [PHP] APC & FastCGI != upload progress ?
- Next by Date: Re: [PHP] preg_replace_callback(), how to pass function argument/param?
- Previous by thread: preg_replace_callback(), how to pass function argument/param?
- Next by thread: Re: [PHP] preg_replace_callback(), how to pass function argument/param?
- Index(es):