Codeigniter preg_replace_callback

请求翻译

I would like for preg_replace_callback to use a library function from CodeIgniter as its callback. My current unsuccessful attempt is the following:

$content = preg_replace_callback('/href="(\S+)"/i',
    '$this->util->url_to_absolute("http://www.google.com","$matches[0]")',
    $content);

But I haven't had any success. I've tried using create_function, but I can't get that to work either. Any help would be greatly appreciated.

2个回答