【发布时间】:2012-03-09 10:15:02
【问题描述】:
所以我将提供此代码,例如:
$str='<title>Test title here</title><meta name="description" content="test meta content here">';
$jftitle="here title 1";
$jfmeta ="here meta 2";
我有:
$str=preg_replace(array('/<title>(.*)<\/title>/i','/<meta name="description" content="(.*)">/i'),array('<title>'.$jftitle.'</title>','<meta name="description" content="'.$jfmeta.'">'),$str);
如果我对 $str 进行回显,它会返回“”。 谁能指出我正确的方向?
【问题讨论】:
标签: php html regex preg-replace