I have looped through an array and can successfully print out the rows that I need to work with
foreach($array['Stock'] as $row) {
echo '|' . $row['Code'] . '|' . intval($row['Onhand']) . "\r\n";
}
I need to have all of the printed rows to be saved in a csv file. Should I be converting to an array first and then creating a csv or can I do it from within the loop?
Just to clarify guys, the file requirements are
'This CSV file must contain 3 columns, separated by the pipe symbol (|), without column names. '
|for a csv I would have expected to see a comma used. Will add an answer but could you clarify this please