-2
My doubt is very simple.
Problem: I have a repeating loop foreach, and in this repeating loop I separate the dates ($data['DATA'] is where I separate) and at each value found it should add the current value to the previous one of the same date (because there are many records on the same day), my problem is that I’m not getting the previous value of that same date.
Example:
foreach ($indices as $dados)
{
$retorno['semana'][$dados['DATA']][] = calcula(count($dados['NOTA']-1), $dados['NOTA']);
}
Function Calculates:
function calculaHoras($valor_anterior, $valor_atual)
{
$resultado = $valor_anterior + $valor_atual;
}