[PHP-DOC] RE: [PHP] preg_replace_callback From: John W. Holmes (holmes072000 <email protected>)
Date: 11/17/02

"callback" should be the name of a function that determines what the
matched pattern will be replaced with.

Maybe you just need the regular preg_replace(), instead of the one with
callback?

---John Holmes...

> -----Original Message-----
> From: Bikeman [mailto:bikeman82 <email protected>]
> Sent: Sunday, November 17, 2002 2:23 PM
> To: phpdoc <email protected>; php-general <email protected>; php-
> lang <email protected>
> Subject: [PHP] preg_replace_callback
>
> 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
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Documentation Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php