Home  >  Article  >  Backend Development  >  What to do if php passthru is garbled?

What to do if php passthru is garbled?

藏色散人
藏色散人Original
2022-11-08 09:16:021576browse

Solution to php passthru garbled code: 1. Run the corresponding php file; 2. Check the output "echo passthru("ipconfig");"; 3. Add "header("content- type:text/html;charset=gbk2312");" is enough.

What to do if php passthru is garbled?

The operating environment of this tutorial: Windows 7 system, PHP version 8.1, Dell G3 computer.

php passthru What should I do if the code is garbled?

php code to solve the problem of garbled characters

When using the passthru function of php, garbled characters appeared

Code:

What to do if php passthru is garbled?

Solution:

Add

header("content-type:text/html;charset=gbk2312");

charset in front of the original code - followed by the modified encoding

Code:

What to do if php passthru is garbled?

Recommended study: "PHP Video Tutorial"

The above is the detailed content of What to do if php passthru is garbled?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:Why doesn’t php6Next article:Why doesn’t php6