preg_replace_callback("/aaa/", "fun1", $str);
function fun1($matches, 能不能在这里加一个参数?)
{
return $matches[1] . "http://d-softs.com/other/subprocess.php?url=" . $matches[2];
}
function fun1($matches, 能不能在这里加一个参数?)
{
return $matches[1] . "http://d-softs.com/other/subprocess.php?url=" . $matches[2];
}
$str = 'abc';
$x = "-";
$c = preg_replace("/([a-z])(?!$)/e", "fun1('\\1','".$x."')", $str);
function fun1($_1,$p)
{
return $_1.$p;
}
echo $c;//a-b-c