3
我正在使用Php Html Dom Parser來獲取元素。但它沒有得到和內部文本元素。請參閱下面的代碼;Php Html Dom Parser沒有得到<style>和<script>元素
$html = file_get_html($currentFile);
foreach($html->find('style') as $e){
echo $e->plaintext;
}
我有這種類型的網頁上的CSS代碼
<style type="text/css">
ul.gallery li.none { display:none;}
ul.gallery { margin:35px 24px 0 19px;}
</style>
<!--<![endif]-->
<style type="text/css">
body { background:#FFF url(images/bg.gif) repeat-x;}
</style>
,我想每元素與內部文本。
感謝
太好了!它正在工作。謝謝:) –
@SmacAfzal沒有概率兄弟 – user1978142