Example
| The code is as follows: |
Copy code |
Function repalceTA ($ str ){ Preg_match_all ("/] +>/isU ", $ str, $ arr ); For ($ I = 0, $ j = count ($ arr [0]); $ I <$ j; $ I ++ ){ $ Str = str_replace ($ arr [0] [$ I], "", $ str ); } Return $ str; } |
Preg_match_all function in php
Preg_match_all-execute a global regular expression to match
Int preg_match_all (string $ pattern, string $ subject [, array & $ matches [, int $ flags = PREG_PATTERN_ORDER [, int $ offset = 0])
Search all matching results of the regular expression specified by pattern in subject and output them to matches in the order specified by flag.
After the first match is found, the child sequence continues searching from the last matched position.
Str_replace function in php
Definition and usage
The str_replace () function uses one string to replace other characters in the string.
Syntax
Str_replace (find, replace, string, count)