如何从下一个字符串中获取粗体值?
<td>26/02/2015</td><td>09:00</td><td>26/02/2015</td><td>12:00</td><td>3</td><td>I1/121</td><td>10074 codification</td><td>103126 Codification, Cooperation and development - 11</td><td>**Walter** Shelter, Mary; **Johnson** Smith, Robert; **Dickinson** Queen, Patty</td><td>without group</td>
考虑到我想要获得的值可能更多或更少。例如,&lt; td&gt;和&lt; / td&gt;可以是:
沃尔特谢尔特,玛丽; 约翰逊史密斯,罗伯特; 迪金森女王,帕蒂; 更多价值观,约翰; AndMore 价值观,Alfred;
或者
少价值观,约翰; AndLess 价值观,Alfred;
我尝试使用正则表达式,preg_split,preg_match,implode,explode并且无法解决这个问题。谢谢!
编辑:这是我正在尝试的。
$myMatches = array();
if(preg_match_all("~\<td\>{9}(.+?)\<\/td\>~",$filtered,$mat)){
foreach($mat[1] as $match){
$myMatches[] = htmlentities($match);
}
}
foreach ($myMatches as $m){
echo $m;
}