I'm trying to have 2 columns in every row in a csv file using php, but I only get one column, can anyone see what I'm doing wrong, any help would be appreciated.
$csvLinks = array();
if ($this->request->isPost()) {
$csvLinks = $this->request->data['csvLinks'];
}
$col = array();
for($i=0; $i<count($csvLinks); $i+=2) {
array_push($col, $csvLinks[$i]);
array_push($col, $csvLinks[$i+1] .",");
}
foreach($col as $row) {
fputcsv($fp, explode(',',$row));
}
the result I'm getting looks like the following