0
(有將在HTML其他I幀,所以我想通過類名來稱呼他們)獲得的getAttribute SRC由getElementsByClassName方法不工作PHP的DOMDocument
我想:
$html = "<iframe width='100%' height='600' class='report' id='CReport' src=' http://www.example.com' ></iframe>";
$doc = new DOMDocument();
@$doc->loadHTML($html);
$tags = $doc->getElementsByClassName('report');
$url = $tags->getAttribute('src');
echo $url;
有人嗎?嘗試了很多東西 – newuser0250