0

I found this solution on how to render csv using zf2 here: Zend Framework 2 - Rendering CSV data

The problem is the default separator is ','. I need to change it because some of the data content I'm rendering have commas in it.

My question is how do I change the default separator from ',' to tab or something else.

Thanks in advance!

Community
  • 1
  • 1
raz
  • 409
  • 6
  • 17
  • 1
    How are you constructing your CSV structured data in the first place?. The question you reference points only to the response headers and rendering but you need to provide a sample of how are you building the CSV content. – Jean Paul Rumeau Sep 04 '14 at 18:43
  • like this: $content = $val.','.$val2."\n"; – raz Sep 04 '14 at 19:14

1 Answers1

0

Found a simple solution to my problem. I just put each value inside " " so the commas would be ignored.

$content = '"'.$val.'","'.$val2.'"';

raz
  • 409
  • 6
  • 17