rgb192
asked on
csv square character
the csv file sometimes get a square character
how to clean up input/ output
how to clean up input/ output
<?php
require_once('../common.php');
$sql = "SELECT * FROM productfolders WHERE active = '1' ORDER BY name";
$products = dbfetcharray($sql);
$fp = fopen('file.csv', 'w');
$cols = array('folderid', 'name');
fputcsv($fp, $cols);
foreach($products as $p){
fputcsv($fp, array($p['folderid'], $p['name']) );
}
fclose($fp);
?>
ASKER
i would like all the just numbers and letters in the output
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
Thanks for the points, ~Ray
You can clean up the data with a REGEX maybe something like this...
Open in new window