我想<span> </span>
从 HTML 的所有标签之间获取数组中的文本,我尝试过使用此代码,但它只返回一次:
preg_match('/<span>(.+?)<\/span>/is', $row['tbl_highlighted_icon_content'], $matches);
echo $matches[1];
我的 HTML:
<span>The wish to</span> be unfairly treated is a compromise attempt that would COMBINE attack <span>and innocen</span>ce. Who can combine the wholly incompatible, and make a unity of what can NEVER j<span>oin? Walk </span>you the gentle way,
我的代码只返回一次 span 标签,但我想以 php 数组的形式从 HTML 中的每个 span 标签中获取所有文本。