简单解释一些代码:
第一个 ~(<[^>]+?>)~si
这个正则是匹配<………>中的内容。简单说是所有的<标签>。
第二个 ~<([a-z0-9]+)[^/>]*?/>~si
这个正则是匹配<……/>中的内容。是单闭合标签 如
第三个 ~([a-z0-9]+)[^/>]*?>~si
这个正则是匹配中的内容。也就是结束标签 如
第四个 ~<([a-z0-9]+)[^/>]*?>~si
匹配<......>中的内容。这和第一个是不一样的,这一个是真正的html标签,因为html标签只有数字和字母,如:
测试 | 124"; echo subHtml($str); ?>
Étiquettes associées:
source:php.cn
Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn
Derniers articles par auteur
Derniers numéros
Appel à une fonction non définie create_function()
Je reçois ce message sur la page d'accueil du site : Erreur fatale : Erreur non détectée :...
Depuis 2023-11-16 19:00:36
0
1
277
PHP coupe les espaces Unicode
J'essaie de couper les espaces Unicode tels que ce caractère et j'ai pu le faire en utilis...
Depuis 2023-11-13 08:49:45
0
2
398
Rubriques connexes
Plus>
|