Skip to content

Instantly share code, notes, and snippets.

@jjcodes78
Created March 28, 2017 02:47
Show Gist options
  • Save jjcodes78/f2418cfcf7aec26b7368d3f83022b499 to your computer and use it in GitHub Desktop.
Save jjcodes78/f2418cfcf7aec26b7368d3f83022b499 to your computer and use it in GitHub Desktop.
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