protected function zSliceNotas($array)
{
$iCount = 0;
$xCount = 0;
$resp = array();
foreach ($array as $linha) {
if (substr($linha, 0, 4) == 'NOTA') {
$resp[$xCount]['init'] = $iCount;
if ($xCount > 0) {
$resp[$xCount - 1]['fim'] = $iCount;
}
$xCount += 1;
}
$iCount += 1;
}
$resp[$xCount - 1]['fim'] = $iCount;
foreach ($resp as $marc) {
$length = $marc['fim'] - $marc['init'];
$aNotas[] = array_slice($array, $marc['init'], $length, false);
}
return $aNotas;
}