world!"); ?>]. The strip_tags() function can remove html, xml and PHP tags."/> world!"); ?>]. The strip_tags() function can remove html, xml and PHP tags.">

Home >Backend Development >PHP Problem >How to remove xml tags in php

How to remove xml tags in php

王林
王林Original
2021-10-18 17:08:472619browse

php method to remove xml tags: [d5cb198d9387ad6674eb8917e4cd7826world!0d36329ec37a2cc24d42c7229b69747a"); ?>]. 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>");
?>

Output:

Hello world!

Example 2

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

Output:

Hello world!

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!

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