|<\/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
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.
*?>
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!