|<\/p>/is","", $str)]. The preg_replace() function is used to perform a regular expression search and replacement."/> |<\/p>/is","", $str)]. The preg_replace() function is used to perform a regular expression search and replacement.">

Home  >  Article  >  Backend Development  >  How to use regular expression to remove p tag in php

How to use regular expression to remove p tag in php

藏色散人
藏色散人Original
2020-09-07 10:39:564657browse

php uses regular expressions to remove the p tag: [preg_replace("/9f20b44b17d19c5ae8308ab9e4652c7e|8a45c867fd727fc770712bce9321033f/is","", $str)]. The preg_replace() function is used to perform a regular expression search and replacement.

*?>

How to use regular expression to remove p tag in php

The preg_replace() function is used to perform a regular expression search and replacement.

Recommended: "php Video Tutorial"

The code example is as follows:

$new = preg_replace("/<p.*?>|<\/p>/is","", $str);
var_dump($new);

The above is the detailed content of How to use regular expression to remove p tag 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