I wish to load some Chinese characters into a csv file, however the following code only works with English words, anyone knows how to change the code so it works with Chinese characters?
Many thanks,
Cat
$pfw_file_name = "registration.csv";
$pfw_first_row = "title,First Name,Last Name,Job Title,Company,Email,Telephone Number,Fax Number,Address 1,Address 2,City,County,Postcode,Country,ID,Other\r\n"; //Content-type: text/html; charset=utf-8\r\n
$pfw_values = "$title,$firstName,$lastName,$jobTitle,$company,$email,$tel,$fax,$address1,$address2,$city,$county,$postcode,$country,$id,$other\r\n";
$pfw_is_first_row = false;
if(!file_exists($pfw_file_name))
{
$pfw_is_first_row = true;
}
if (!$pfw_handle = fopen($pfw_file_name, 'a+')) {
die("Cannot open file ($pfw_file_name)");
exit;
}
if ($pfw_is_first_row)
{
if (fwrite($pfw_handle, $pfw_first_row ) === FALSE) {
die("Cannot write to file ($pfw_filename)");
exit;
}
}
if (fwrite($pfw_handle, $pfw_values) === FALSE) {
die("Cannot write to file ($pfw_filename)");
exit;
}
fclose($pfw_handle);