除了我关于分析 html 和搜索<p> and <ul>/<ol>
标签这个问题的其他问题。
$in = '<p>Bit\'s of text</p><p>another paragraph</p><ol><li>item1</li><li>item2</li></ol><p>paragraph</p>';
function geefParagrafen($in){
$dom = new domDocument;
$dom->loadHTML($in);
$x = $dom->documentElement;
}
这就是我有多远。将 $out 作为包含以下内容的数组的方法是什么:
$out = array('<p>Bit's of text</p><p>another paragraph</p>',
'<p>another paragraph</p>',
'<ol><li>item1</li><li>item2</li></ol>',
'<p>paragraph</p>');
提前致谢!我真的迷失在 domdocument 结构中。