嗯......我如何在调用preg_replace时使用变量?
这不起作用:
foreach($numarray as $num => $text)
{
$patterns[] = '/<ces>(.*?)\+$num(.*?)<\/ces>/';
$replacements[] = '<ces>$1<$text/>$2</ces>';
}
是的,$num
由加号preceeded。是的,我想要“tag the $num as <$text/>
”。
感谢Gumbo,Paul - 您的投入都有帮助! – Steve 2009-09-09 16:56:58