In my case, I want to redirect an output result to a file, php test.php > test.log Then look at the test.log situation, and then find Chinese garbled characters. Operation in phpstorm
Solution.
echo mb_convert_encoding('中文','gbk','utf-8');
iconv("GBK","UTF-8",'中文');
You can try both methods