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

What to do if php passthru is garbled?

藏色散人
Release: 2023-03-17 12:06:01
Original
1778 people have browsed it

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:

<?php
echo passthru("ipconfig");
?>
Copy after login

What to do if php passthru is garbled?

Solution:

Add

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

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

Code:

Copy after login

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!

Related labels:
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