Linked Questions
13 questions linked to/from Convert array to CSV and force download
0 votes
1 answer
181 views
How to create a downloadable csv file from an array? [duplicate]
I have an array like this : $data = [ ["firstname" => "Mary", "lastname" => "Johnson", "age" => 25], ["firstname" => "Amanda", "lastname" => "Miller", "age" => 18], ["...
-2 votes
1 answer
58 views
How to convert array to csv [duplicate]
Is there any PHP code that could transform or convert these array into a CSV file? Array ( [0] => rubbish [1] => bad [2] => hate [3] => abandoned [4] => abused [5] => accused [6] => addicted [7] => ...
0 votes
2 answers
9k views
how to write unified new line in PHP?
Obviously it's not "\r\n",which only fits windows,and will cause ^M on linux
1 vote
1 answer
2k views
Export MSSQL Query To CSV File From PHP
I am using the below syntax within my joomla article and I am in need of a way to add a php button (I know the syntax or this) - and on the button press event fire off exporting the SQL Query Results (...
0 votes
1 answer
609 views
export array content to csv row with php
I am trying to export an array to csv, but my csv contains only one row with many fields (columns). I want to achieve to export into rows my data. My data looks like when I dump: array(2) { [0]=> ...
0 votes
3 answers
345 views
How can an associative multidimensional (multiple dimensions) PHP array get converted to downloadable CSV?
I have an associative multidimensional (dynamic length of dimensions) array. It originally comes from JSON data, but I understand that just makes things harder so I convert it using json_decode($...
0 votes
2 answers
340 views
Insert multidimensional array into csv in PHP
I have an array which is structured like this [cars] => Array ( [0] => 43063 [1] => 17306 [2] => 116078 ) [houses] => Array ( [0] =>...
-2 votes
2 answers
210 views
How to export array into csv
["Boxname:HH, X1:53.3, X2:106.6, Y1:33.300000000000004,Y2:59.947215189873425, PID:22, GENDER:MALE, Age:63,Bp_Systolic:120,Bp_Diastolic:80", "Boxname:HH, X1:53.3, X2:106.6, Y1:33.300000000000004,Y2:59....
-3 votes
2 answers
102 views
How to directly write to CSV using PHP [duplicate]
I'm trying to use 'for loop' and write directly to csv without inserting into database and export as csv file. <?php require_once('function.php'); for ($i=0; $i < 6000; $i++) { # code.....
0 votes
2 answers
130 views
php export MySql to excel sheet wont work
The error message i am getting is with the headers. I am using mysqli_ i used mysql_ on a blank page to test it. When I put it into the click on my real page it told me I couldn't use mySql_ as it was ...
0 votes
1 answer
132 views
MySQL "AS" strings don't output to TXT file [duplicate]
I have a PHP script that query's a count of specific rows per user in a table. I then have the SQL query use "AS" to output the count under each user's respective count; like so: <?php $servername ...
0 votes
0 answers
89 views
PHP DOMDocument Html table to XML
I'm using a simple PHP script on Altervista provider to get data from a very big HTML table (more than 6300 rows) at this link. The problem is the "Maximum execution time of 30 seconds exceeded" ...
0 votes
0 answers
77 views
Force download with php
I'm preparing a CSV file to download. I know I'm nearly there as the link at the end of this code produces the right result. What I need to do and don't understand why it doesn't work, is create the ...