View Single Post
Old 01-22-2009, 02:47 PM   #3 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Do you mean something like this?

php Code:
class TalkPHP_Callback
{
    public function get($aCaptured)
    {
        return $aCaptured[1];
    }
}

$pCallback = new TalkPHP_Callback();
echo preg_replace_callback('~I Love (.+)~', array($pCallback, 'get'), 'I Love TalkPHP');
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote