正则采东西,是中文有问题有(帮着老师做项目,若此难不除,将无法评奖学金,谢谢)
$str=" 【<strong>中药名</strong>】艾叶 aiye</p>";
preg_match('/【<strong>中药名<\/strong>】(.*)<\/p>/iUs',$str,$match1);<br />
$str=" 【<strong>中药名</strong>】艾叶 aiye</p>";
preg_match('/【中药名<\/strong>】(.*)<\/p>/iUs',$str,$match1);
print_r($match1);
Array<br />(<br /> [0] => 【<strong>中药名</strong>】艾叶 aiye</p><br /> [1] => 艾叶 aiye<br />)<br />怎么不行?
$str=" 【<strong>中药名</strong>】艾叶 aiye</p>";
preg_match('/【中药名<\/strong>】.*(\w+)<\/p>/iUs',$str,$match1);
print_r($match1);
Array<br />(<br /> [0] => 【<strong>中药名</strong>】艾叶 aiye</p><br /> [1] => aiye<br />)<br />