PHPstr_replace replace multiple sensitive words [urgent, online, etc.] This post was last edited by u011123799 from 2013-06-1912: 42: 46 $ html & nbsp; htmlReplace ($ body, & nbsp; 0); & nbsp; filter echo & nbsp; $ html; the output content is: & amp; lt; pre PHP str_replace replaces multiple sensitive words (urgent, online, etc]
This post was last edited by u011123799 at 12:42:46
$ Html = HtmlReplace ($ body, 0); // filter
Echo $ html; // The output content is: <pre class = "lang-js">
// Compile it into HTML:
/************* The above background *************/
$ Html = str_replace ("<pre class =" lang-js "> ","", HtmlReplace ($ body, 0 ))
After the replacement, the output is normal, but the problem arises!
I want to replace multiple tags, such :,
,
- ...
It's silly to write one by one! Is there any way to define the content required for replacement at a time?
For example:
<Span> =
<Ul> =
<Li> =
Beginner
PHP Palm? Pre HTML
Share:
------ Solution --------------------
Echo htmlspecialchars_decode ($ html, ENT_QUOTES );
------ Solution --------------------
#1 specifically deals with html tags
You can also use arrays and regular expressions.