Here is my PHP code:
<?php
header('Content-Type: application/excel');
header('Content-Disposition: attachment; filename="sample.csv"');
$data = array(
'فرید',
'علی'
);
$fp = fopen('php://output', 'w');
foreach ( $data as $line ) {
$val = explode(",", $line);
fputcsv($fp, $val);
}
fclose($fp);
and here is the output:
why فرید
and علی
looks vague in the export file? I don't know what ÙØ±ÛŒØ
and علی
even mean. anyway, does anybody know how can I fix it? In other word, how can I make a CSV export of an array which contains Persian characters?