PHP user-defined function: removes all html tags. PHP custom function: remove all html tags? Phpfunctionpregstring ($ str) {$ strtemptrim ($ str); $ searcharray (| Uis, | script [^]. *? Script | Uis, remove javascript | [Custom PHP function: remove all html tags
-
- Function pregstring ($ str ){
- $ Strtemp = trim ($ str );
- $ Search = array (
- "| Uis ",
- "| ]. *? Script | Uis ", // remove javascript
- "| [Word definition]. * [/word definition] | Uis", // remove the thumbnail
- "| <[/!]. *? [^ <>] *?> | Uis ", // remove the HTML tag
- "> (Quot | #34); I", // replaces the HTML object
- "> (Amp | #38); I ",
- "|, | Uis ",
- "| [S] {2,} | is ",
- "[> Nbsp;] isu ",
- "| [$] | Uis ",
- );
- $ Replace = array (
- "'",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- "",
- );
- $ Text = preg_replace ($ search, $ replace, $ strtemp );
- Return $ text;
- }
- Echo pregstring (string); // call a function
- ?>
Why? Php function pregstring ($ str) {$ strtemp = trim ($ str); $ search = array ("| Uis", "| script [^]. *? /Script | Uis ", // remove javascript" | [set the word...