无法计算出带有2个数组的返回preg_replace

时间:2019-03-22 12:36:53

标签: php preg-replace

我不知道此函数的返回结果……非常感谢!

function convert_links($string, $base) {
    $pattern = array(',<(a|link|img|script|form|td)([^>]+)(href|src|action|background)="([^>"\s]+)",ie',
                    ',<(a|link|img|script|form|td)([^>]+)(href|src|action|background)=([^>"\s]+),ie',
                    ',<style(.+)url\("([^>"\s]+)",ie');
    $replace = array('"<\1\2\3=\"" . absolute_link("\4", $base,"1 \1") . "\""',
                    '"<\1\2\3=\"" . absolute_link("\4", $base,"2 \1") . "\""',
                    '"<style\lurl(\"" . absolute_link("\2", $base) . "\""');
    return preg_replace($pattern, $replace, $string);

0 个答案:

没有答案