ذخیره فایل متنی با یونیکد UTF-8 در php
نحوه استفاده از فاکشن:کد PHP:
function writeUTF8File($filename,$content) {
$f=fopen($filename,”w”);
# Now UTF-8 – Add byte order mark
fwrite($f, pack(“CCC”,0xef,0xbb,0xbf));
fwrite($f,$content);
fclose($f);
}
$filename = نام فایل متنی
$ content= محتوای متنی
ذخیره فایل متنی به صورت UTF-8