首页 > 开发 > PHP > 正文

PHP写入WRITE编码为UTF8的文件的实现代码

2024-05-04 22:12:21
字体:
来源:转载
供稿:网友
<?php 
$f=fopen("test.txt", "wb"); 
$text=utf8_encode("顨!"); 
// adding header 
$text="/xEF/xBB/xBF".$text; 
fputs($f, $text); 
fclose($f); 
?> 
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表