#...# the # and # are just characters to start en end a REGEX
(you can use a lot of character for this)
#exi the e, x and i flags. See the PHP.net site for information
about it
< the < character
(?!...) a negative lookahead. The REGEX matches when the characters
after this are NOT equal to one of those
[/a-z] a character class, matches for the / character and the
letters a - z
| OR
(?<=\s) a positive lookbehind. The REGEX maches when there is
\s (whitepspace) before
> the > character
(?![a-z]) negative lookahead for the letters a - z
なので、基本的にはタグとして使われていない全て<の>文字にマッチします。たとえば、<fooand</fooは一致しfoo>ません。でも1 < 3合います。htmlentitiesこれは関数に渡され、になり1 < 3ます。strip_tagsこれで、タグのみを削除するために使用できます。