-2
我想弄清楚如何抓住H1內部的字符串,實際上沒有H1內的字符串。PHP查找功能沒有找到元素html
$html = "<div id="test"><h1>hello world</h1></div>"
foreach($html->find('div[id=test] h1') as $test1){
echo '<div>';
echo $test1;
echo '</div>';
}
$test1 returns "<h1>hello world</h1>"
我想$ test1只是「hello world」而沒有h1標籤。謝謝你在前進
這並不似乎是有效的PHP的。 –
'echo「
」.strip_tags(「 」)。「
」;' – samayohello world
啊,帶標籤。非常感謝! echo strip_tags($ test1); – user3097760