Created
March 28, 2017 02:47
-
-
Save jjcodes78/f2418cfcf7aec26b7368d3f83022b499 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getCooperativas($table) | |
{ | |
$coopTable = $table->nextSibling(); | |
//percorre até a próxima tabela | |
do | |
{ | |
$coopTable = $coopTable->nextSibling(); | |
} while($coopTable->tag != "table"); | |
$cooperativas = []; // array com as cooperativas | |
$cooperativa = []; // array com as informações de cada cooperativa | |
foreach ($coopTable->children() as $coopTrs) | |
{ | |
foreach ($coopTrs->children() as $coopInfo) | |
{ | |
$cooperativa[] = trim($coopInfo->plaintext); | |
} | |
$cooperativas[] = $cooperativa; | |
$cooperativa= []; | |
} | |
return $cooperativas; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment