问题
I have the following code
$html3->find('TR[d=lt]',0);
for the following source code
<TR>
<TH NOWRAP ALIGN=RIGHT VALIGN=TOP> Date:</TH>
<TD d="lt">
2011-05-31 </TD>
</TR>
<TR>
<TH NOWRAP ALIGN=RIGHT VALIGN=TOP>Title:</TH>
<TD d="lt">
NETWORKS</TD>
</TR>
<TR>
<TH NOWRAP ALIGN=RIGHT VALIGN=TOP>Title:</TH>
<TD d="lt">
Low NETWORKS</TD>
</TR>
<TR>
<TH NOWRAP ALIGN=RIGHT VALIGN=TOP>Description:</TH>
<TD d="lt">
CD</TD>
</TR>
however the code only returns as an string the DATE instead of the an array of all the vaules,
回答1:
wow that's pretty sparse on your question code.
However, take a look here:
http://simplehtmldom.sourceforge.net/manual.htm#section_find
You will find that passing in the int as the second arg tells the function you are looking for a specific element. Get rid of the second arg and you should get an array of all results back.
来源:https://stackoverflow.com/questions/16430802/simple-html-dom-returning-string-instead-of-array