Reputation: 69
i have array in fputcsv and need output without quotation marks on cells with space. I tried remove with null char, but these are just additional spaces and its not usable solution for me. Any ideas please?
I have this code...
fputcsv($handle, array($zbozi['kod_zbozi'], $zbozi['nazev'] ),';');
and I receive...
123456;"hdd adata"
but I want...
123456;hdd adata
Upvotes: 0
Views: 1566
Reputation: 69
I created own function from current fputcsv.
<?php function vujo_fputcsv($handle, $fields, $delimiter = ',') { if (!is_resource($handle)) {user_error('fputcsv() první parametr musí být data, ale tys mě dal' . gettype($handle) . '!', E_USER_WARNING);
return false;}
$str = '';
foreach ($fields as $cell) {$str .= $cell . $delimiter;}
fputs($handle, substr($str, 0, -1) . "\n");
return strlen($str);} ?>
Upvotes: 2