Home > Backend Development > PHP Tutorial > response.write PHP implementation code for writing files encoded as UTF8 by WRITE

response.write PHP implementation code for writing files encoded as UTF8 by WRITE

WBOY
Release: 2016-07-29 08:38:21
Original
2425 people have browsed it

$f=fopen("test.txt", "wb");
$text=utf8_encode("桨!");
// adding header
$text="xEFxBBxBF".$text;
fputs($f, $text);
fclose($f);
?>

The above introduces the implementation code of response.write PHP writing WRITE encoded UTF8 files, including the content of response.write. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template