Skip to content

Instantly share code, notes, and snippets.

@hackaugusto
Created July 3, 2012 00:01
Show Gist options
  • Select an option

  • Save hackaugusto/3036515 to your computer and use it in GitHub Desktop.

Select an option

Save hackaugusto/3036515 to your computer and use it in GitHub Desktop.
php
<?php
$arr = array();
foreach( $tr_list as $count => $tr ){
$td_list = $xpath->query('//td',$tr);
$new = array();
foreach( $td_list as $i => $data ){
$i_ = $i % count($fields);
$new[$fields[$i_]] = $data->textContent;
}
array_push($arr, $new);
unset($new);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment