【发布时间】:2014-04-05 11:38:41
【问题描述】:
我正在尝试使用preg_replace_callback() 调用任何函数,并将其参数嵌入在字符串中。
$string = "some text ucfirst('asd')";
$pattern = "~ucfirst([a-z]+)\(\)~";
$string = preg_replace_callback($pattern, "ucasef", $string);
echo $string; // some text Asd
我需要一些有关该模式的帮助,以及如何使用它来完成示例输出。
【问题讨论】:
标签: php regex preg-replace-callback