A question about fwrite in php

I am doing a file data writing function. I need to read all the data in the file first, use regular processing, and then merge with the data transmitted through GET in the client form to write to the file. But I have encountered a problem, that is, after processing, the Chinese part of the string that needs to be written into the file can be displayed normally, but after using fwrite to write to the file, although the Chinese that already exists in the file is normal, But the Chinese in the additional data has become a u number, this form of coding, there is no boss to know the reason and the solution.

Php
Mar.21,2021

u code? Is
in u plus number format?

is it linux or windows?

is usually a character set problem, just convert it.

besides, you'd better give a screenshot.


well, append part of the data, call json_encode, to convert Chinese into unicode internal code representation, the solution is to first call urlencode and then call json_encode conversion, and finally use urldecode to restore.

Menu