File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -404,17 +404,16 @@ public function toJson(array $header=NULL) : string {
404
404
* @return string
405
405
*/
406
406
public function toCsv (array $ header =NULL ) : string {
407
- $ parseHeader = [];
408
407
$ parsedData = $ this ->toArray ($ header );
409
408
$ csvData = '' ;
410
- if (!empty ($ parsedData )) {
411
- if (!empty ($ this ->header )) {
412
- if (!empty ($ header )) {
413
- $ csvData .= implode ($ this ->delimiter , $ header ).PHP_EOL ;
414
- } else {
415
- $ csvData .= implode ($ this ->delimiter , $ this ->header ).PHP_EOL ;
416
- }
409
+ if (!empty ($ this ->header )) {
410
+ if (!empty ($ header )) {
411
+ $ csvData .= implode ($ this ->delimiter , $ header ).PHP_EOL ;
412
+ } else {
413
+ $ csvData .= implode ($ this ->delimiter , $ this ->header ).PHP_EOL ;
417
414
}
415
+ }
416
+ if (!empty ($ parsedData )) {
418
417
foreach ($ parsedData as $ row ) {
419
418
$ csvData .= implode ($ this ->delimiter , $ row ).PHP_EOL ;
420
419
}
You can’t perform that action at this time.
0 commit comments