Home > Backend Development > PHP Tutorial > The efficacy and function of American ginseng tablets and how to consume them. How to generate UTF8 files with PHP

The efficacy and function of American ginseng tablets and how to consume them. How to generate UTF8 files with PHP

WBOY
Release: 2016-07-29 08:42:41
Original
980 people have browsed it

Copy the code The code is as follows:


$f=fopen("test.txt", "wb");
$text=utf8_encode("a!");
//First Use the function utf8_encode to convert the data to be written into UTF encoding format.
$text="\xEF\xBB\xBF".$text;
//"\xEF\xBB\xBF", this string of characters is indispensable, the generated file will be in UTF-8 format, otherwise it will still be in ANSI format.
fputs($f, $text);
//Write.
fclose($f);
?>

The above introduces the efficacy and function of American ginseng slices and how to consume them. The method of generating UTF8 files with PHP includes the efficacy and role of American ginseng slices and how to consume them. I hope it will be helpful to friends who are interested in PHP tutorials.

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