-2

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] => afraid [8] => aggravated [9] => aggressive [10] => alone [11] => angry [12] => anguish [13] => annoyed [14] => anxious [15] => apprehensive [16] => argumentative [17] => artificial [18] => ashamed [19] => assaulted [20] => atrocious [21] => attacked [22] => avoided [23] => awful [24] => awkward [25] => badgered [26] => baffled [27] => banned [28] => barren [29] => beat [30] => beaten )

0

1 Answer 1

0

You can use fopen and fputcsv function to write in csv file. Make sure the path is writable.

$rowData = array(
    array(1,2,3),
    array(1,2,3),
);

$fp = fopen('test.csv', 'w');

foreach ($rowData as $fields) {
    fputcsv($fp, $fields);
}
fclose($fp);

For more details please refer to PHP Manual

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.