FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Send .csv file to browser
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Send .csv file to browser [message #170038 is a reply to message #170007] Wed, 06 October 2010 16:25 Go to previous messageGo to previous message
Peter H. Coffin is currently offline  Peter H. Coffin
Messages: 245
Registered: September 2010
Karma:
Senior Member
On Tue, 05 Oct 2010 11:11:24 -0400, sheldonlg wrote:
> On 10/5/2010 11:06 AM, Derek Turner wrote:
>> On Tue, 05 Oct 2010 10:55:44 -0400, sheldonlg wrote:
>>
>>> The user can then cut and paste it into a file or you can put in code
>>> for the user to download that piece.
>>>
>>> Another approach is to output an Excel file and the user can then output
>>> from that Excel file to a .csv file.
>>
>> Why not? Because it's not very elegant, is it?
>
> WGAS? Why does something have to be "elegent"? All it has to do is:
>
> 1 - Work reliably.
> 2 - Be maintainable.
>
> Besides, haven't you ever heard of K.I.S.S. or Occam's razor?
>
> (WGAS means "who gives a shit").

'cause the method fails miserably at 1.

--------------------------
$ cat foo.php
<?php
$recs = array();
$recs[] = "This is the first line.";
$recs[] = "Line the second, number 2.";
$recs[] = "Line 3, continuing.";
print_r($recs);
$line = implode(',', $recs);
print_r($line);
?>
$ php -f foo.php
Array
(
[0] => This is the first line.
[1] => Line the second, number 2.
[2] => Line 3, continuing.
)
This is the first line.,Line the second, number 2.,Line 3, continuing.$
--------------------------

How many variable columns are there in that output. Three? Five? None?

--
100. Finally, to keep my subjects permanently locked in a mindless
trance, I will provide each of them with free unlimited Internet
access.
--Peter Anspach's list of things to do as an Evil Overlord
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: file access permission?
Next Topic: Process queue without cron jobs
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 10:02:28 GMT 2024

Total time taken to generate the page: 0.04420 seconds