Using php to i created csv file. we using umlaut symbols in my csv file, is not show correct form in .csv files.
I adding spanish text is " DIRECCIÓN ", but i got result like this " DIRECCIÓN "
$filename = "ConnectionsData.csv";
header('Content-Encoding: UTF-8');
header('Content-type: text/csv; charset=UTF-8');
header("Content-Disposition: attachment; filename=\"$filename\"");
//header("Content-Type: text/csv");
$display = fopen("php://output", 'w');
$flag = false;
while($row = mysql_fetch_assoc($query_profiler)) {
if(!$flag) {
// display field/column names as first row
if($x==0){
fputcsv($display, str_replace($tab_name, $rep_tab,array_keys($row)), ",", '"');
$flag = true;
}
}
fputcsv($display, array_values(str_replace("'","'",str_replace("~/"," ",$row))), ",", '"');
}
fclose($display);
}