How to remove xml tags in php

王林
Release: 2023-03-13 11:20:02
Original
2569 people have browsed it

php method to remove xml tags: [world!"); ?>]. The strip_tags() function can remove html, xml and PHP tags.

How to remove xml tags in php

The operating environment of this article: windows10 system, php 7, thinkpad t480 computer.

php provides us with a very convenient function, strip_tags(), with which we can easily delete html, xml and php tags.

Let’s take a look at a specific example:
Example 1

<?php
    echo strip_tags("Hello <b>world!</b>");
?>
Copy after login

Output:

Hello world!
Copy after login
Copy after login

Example 2

<?php
    echo strip_tags("Hello <b><i>world!</i></b>","<b>");
?>
Copy after login

Output:

Hello world!
Copy after login
Copy after login

Recommended learning: php training

The above is the detailed content of How to remove xml tags in php. 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