PHP:在preg_replace中调用函数

The below code responsible for bbcode tags in dle script. "\1" is the link which i would like to call with function, but instead I'm getting plain text

        $txt = preg_replace( "#<!--dle_video_begin:(.+?)-->(.+?)<!--dle_video_end-->#is", '[video=\\1]', $txt );

my function

function videoD ($str) {
        if (strpos($str,'http://') !== false) {
                $vid = uppod_encode($str);
                echo (uppod_encode($str));

        } else {
                $vid = uppod_decode($str);
                echo (uppod_encode($vid));
        }
}

what i've tried:

$txt = preg_replace( "#<!--dle_video_begin:(.+?)-->(.+?)<!--dle_video_end-->#is", '[video=videoD(\\1)]', $txt );


$txt = preg_replace( "#<!--dle_video_begin:(.+?)-->(.+?)<!--dle_video_end-->#is", '[video=videoD(1)]', $txt );

$txt = preg_replace( "#<!--dle_video_begin:(.+?)-->(.+?)<!--dle_video_end-->#is", '[video=\\videoD(1)]', $txt );
$txt = preg_replace_callback('#<!--dle_video_begin:(.+?)-->(.+?)<!--dle_video_end-->#is', function($matches){
    return "[video=videoD({$matches[1]})]";
}, $txt);