Solution to cmd php garbled code: 1. In cmd or shellpower on the windows platform, execute the php script and check whether it is garbled; 2. Execute "exec("CHCP 65001");" in the php script. Just use the command to modify the character set of the current page number.
The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.
What should I do if cmd php is garbled?
Use the command line to execute the php script and the output will be garbled
Today, when I execute the php script in cmd or shellpower on the Windows platform, the Chinese output will be garbled.
Modified the registry and also tried to modify the current page number CHCP 65001
But as soon as the php script is executed, the problem may occur again.
Finally came up with a solution, which is to execute the cmd command in the php script to modify the current page number character set
exec("CHCP 65001"); // coding...
Perfect solution
Recommended study: "PHP Video Tutorial》
The above is the detailed content of What to do if cmd php is garbled?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment
