preg_replace_callback
| From: | Bikeman | Date: | Sun, 17 Nov 2002 19:23:10 +0000 |
| Subject: | preg_replace_callback | ||
| Groups: | php.doc php.general php.lang | ||
| Request: | Send a blank email to phpdoc+get-969349758@lists.php.net to get a copy of this message | ||
Hello.
I have totally no clue at all wether I am posting in the right newsgroup
here, and I was not planning on caching all messages in my (first time used,
I prefer Outlook) Outlook Express before searching. So if I am disobeying
all rules here ... I'm sorry ... I just am not an experienced news-service
user ...
Now, my question/remark/bug report. It concerns, ad you could guess, the
preg_replace_callback function. The manual is very short on this function,
and the comments posted on the online-version of the manual, are not helping
me, either ... I am trying to use this function as the regular preg_replace
can be used, namely woth a patterns-array, a replacement-array (which gets
the callback-array) and a subject. This doesn't work, though ... It
appears as if the callback-variant of the preg_replace version isn't capable
of handling multiple patterns at a time. This is the error-message I get:
"Warning: preg_replace_callback() requires argument 2, 'Array', to be a
valid callback in ...". I pass it, as a second argument, an Array that
consists of strings containing the names of functions I defined later in my
php-file. (Hmmm ... Could that be the problem? Tha fact that I define the
functions AFTER I give the Array tot the functions? Don't think so, though
...)
Did anybody have the same experience, or am I really doing something wrong?
Tnx in advance for any reply!!
Bikeman