php正则表达式匹配模式中使用变量

如何在正则表达式模式中使用变量
这样对吗?
$pattern="/$word/";
还是$pattern="/'.$word.'/";

第1个回答  2011-05-31
$pattern="/".$word."/";本回答被提问者采纳
相似回答
大家正在搜