Help with condition to mount csv layout with php

0

I am generating a .CSV for an import where it is returning me the data as you can see in this gist:   link

What happens is that I have 2 treatment lines:

 1: M;123;CSV PRODUCAO;22/05/2017 
 2: *P;30080 ;7891 ;180;163,74 ;160;30080  JOAO SILVA ;2 ;;;22/05/2017 ;;;123

Number 1 is the block header.  

Number 2 would be the lines.

As you can see at the end of the header and the line has a date, what I need, when the two dates are the same, does not repeat the header.  As you can see in the expected gist code.

The reason I'm doing this is that I'm getting another csv, importing, and trying to generate another layoult.

In the gist also has the upload.php where I'm doing everything, could anyone help me?

    
asked by anonymous 30.06.2017 / 03:28

1 answer

0

Reply @ -Kelver (from another community):

does

$dataAuxiliar = '';

if($dataAuxiliar != $VarData){

faz o q tem q fazer....

}

no fechamento do loop alimenta a $dataAuxiliar = $VarData;
    
30.06.2017 / 05:05