"."/> ".">
search
HomeBackend DevelopmentPHP ProblemWhat to do if php does not parse html tags

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 "".

What to do if php does not parse html tags

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
What to do if php does not parse html tags

View code

<?php
    header(&#39;Content-Type:text/plain;charset=utf-8&#39;);    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=&#39;http://s.jf3q.com&#39;>helloword</a>";    echo "<hr>"; 
?>

2. Use meta tag

    <meta charset="UTF-8">
 <?php
        echo "helloword";    echo "<hr>";?>

What to do if php does not parse html tags

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Safe Exam Browser

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

WebStorm Mac version

Useful JavaScript development tools