Friday 15 February 2013

php - Keep special chars when writing to file -



php - Keep special chars when writing to file -

i've created website contains form. when submitting text printed .csv file. problem letters Å Ä Ö printed "Ã¥" or "ä". can maintain letters?

<?php $fname = $_post['fname']; $lname = $_post['lname']; $file = "register.csv"; $person = $fname.';'. $lname."\n"; file_put_contents($file, $person, file_append | lock_ex); ?>

most problem reading file. php script should store letters way receives letters. if you're reading csv file excel - default encoding non-utf. should check file text editor (or import excel setting encoding first), , create sure file opened utf-8.

php

No comments:

Post a Comment