Help with condition to mount csv layout with php

Asked

Viewed 32 times

0

I am generating a . CSV for an import where it is returning me the data as you can see in this gist: https://gist.github.com/otaciobarbosa/b1b442816ec95ff570d6d5c70e8b1f64

What happens is I have 2 lines of treatment:

 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 row has a date, which I need, when the two dates are equal, not to repeat the header. As you can see from the expected gist code.

The reason I’m doing this is I’m taking another csv, importing , and trying to generate another layoult.

In gist also has upload.php where I’m doing everything, someone could help me?

1 answer

0


Reply @-Kelver (from another community):

ago

$dataAuxiliar = '';

if($dataAuxiliar != $VarData){

faz o q tem q fazer....

}

no fechamento do loop alimenta a $dataAuxiliar = $VarData;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.