php - How can I exclude first <tr> -
with php dom, getting trs , tds inside.
<?php foreach($table->getelementsbytagname('tr') $tr){ echo $tr->getelementsbytagname('td')->item(0)->nodevalue); } ?>
can exclude first tr , tds.
i think node list numerically indexed (though cannot test it), using key in foreach may work:
foreach($table->getelementsbytagname('tr') $key => $tr){ // don't act on first element if ($key > 0) { echo $tr->getelementsbytagname('td')->item(0)->nodevalue); } }
Comments
Post a Comment