Can I use Zend_Translate to convert a data array into a csv file?
3
-
Why would you use Zend_Translate? A little more backstory would go a long way to more specific answers...Mike Purcell– Mike Purcell2011-11-04 17:45:46 +00:00Commented Nov 4, 2011 at 17:45
-
maybe zend translate is not the best tool? on my searches it looks like it can handle CSV'sRobbo_UK– Robbo_UK2011-11-07 17:33:03 +00:00Commented Nov 7, 2011 at 17:33
-
Ahhh gotcha. Post some code snippets and we can better help you.Mike Purcell– Mike Purcell2011-11-07 17:52:29 +00:00Commented Nov 7, 2011 at 17:52
Add a comment
|
2 Answers
You can do that with plain php.
Implode the array and echo it out in csv format.
3 Comments
Robbo_UK
yeah but you need to escape comma's and quotes etc. I thought there would be a package on the framework that would help with this
Naftali
@user1030168 nothing to escape, just use explode and implode.
Robbo_UK
what if you have the following $data = array(); $data[] = 'this text'; $data[] = text , more $data[] = text , mo more,and more you would need When you implode this array you would need to escape the comma's inside each data item
found this... how to import CSV using zend
looks like zend translate is not the best option for what I was trying to do