preg_replace_callback stuck

请求翻译

I have an array of URLs I'm running thru an included preg_replace_callback function, the idea being that each loop will yield a new result.

Problem is that it keeps outputting only the first result, as if it stalls after processing the first URL.

Here is the code:

if (!function_exists('name')) {
function name($match)
{
return($match[1]);
}
$foo = preg_replace_callback("#[regex]#", "name", $bar);
}

Any ideas how I can get this to work properly? Thanks.

1个回答