Solution to the problem that php does not parse html tags: 1. Use PHP to set the encoding "charset=utf-8"; 2. Use the meta tag to set "".
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
What should I do if php does not parse the html tag?
php echo html content has been parsed, what is going on, as shown in Figure
View code
<?php header('Content-Type:text/plain;charset=utf-8'); echo "helloword"; echo "<hr>"; ?>
After checking, it is affected by the code header('Content-Type: text/plain;charset=utf-8');.
Here we need to distinguish between text/html and text/plain: text/html is output in the form of html, for example, a text box will be displayed on the page, and in plain form, this paragraph will be displayed on the page as it is. Code
Then there are two ways to modify it
1. Use PHP to set the encoding
<?php header("Content-type: text/html; charset=utf-8"); echo "<a href='http://s.jf3q.com'>helloword</a>"; echo "<hr>"; ?>
2. Use meta tag
<meta charset="UTF-8"> <?php echo "helloword"; echo "<hr>";?>
Recommended study: "PHP Video Tutorial"
The above is the detailed content of What to do if php does not parse html tags. 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

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

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

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

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version
Useful JavaScript development tools
