我需要一些幫助請在這裏。試圖做的是拉出b節點中的所有內容。通過某些html標記集
<P><B>Credit Weighting: </B>5<BR><BR>
<B>Teaching Period(s): </B>Teaching Periods 1 and 2.<BR><BR>
<B>No. of Students: </B>-.<BR><BR>
<B>Pre-requisite(s): </B>None<BR><BR>
<P><A HREF="#top" class="toppage">[Top of page]</A></P>
<P><B>Credit Weighting: </B>20<BR><BR>
<B>Teaching Period(s): </B>Teaching Periods 1 and 2.<BR><BR>
<B>No. of Students: </B>-.<BR><BR>
<B>Pre-requisite(s): </B>None<BR><BR>
<P><A HREF="#top" class="toppage">[Top of page]</A></P>
<P><B>Credit Weighting: </B>10<BR><BR>
<B>Teaching Period(s): </B>Teaching Periods 1 and 2.<BR><BR>
<B>No. of Students: </B>-.<BR><BR>
<B>Pre-requisite(s): </B>None<BR><BR>
<P><A HREF="#top" class="toppage">[Top of page]</A></P>
我能夠從第一set.Below拉的數據是我的示例代碼,這是否
// GETTING ALL THE B NODE STUFFS AND PRINTING IT'S CONTENTS
$result = array();
foreach($document->getElementsByTagName('b') as $node){
$result[preg_replace('/:\s+$/','',$node->textContent)] = trim($node->nextSibling->textContent);
}
var_dump($result);
echo '<br /><br />';
現在什麼我試圖做的是通過三組HTML代碼來獲得環所有的b節點,並得到的contets.Wow我可以去談論這個嗎?
我不明白,那是什麼代碼呢,對吧?或者你的意思是平面陣列? – Searle
是的,這就是我的意思。傳奇!謝謝,這很好 – user1444442