$b=preg_match(‘/<img.+?\/>/’,$hello,$a);
解释:使用正则表达式<img.+? 匹配$hello,并将匹配的数据放在数组$a中。返回参数是匹配的数量 。
$b=preg_replace(‘/<img.+?\/>/’,”,$hello);
解析:使用正则表达式进行替换,使用第二个参数替换$hello匹配正则表达式的数据。替换后的字符串赋值给变量$b.
注意 - 你可以用以下 HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
昵称
邮箱
网址
在此浏览器中保存我的显示名称、邮箱地址和网站地址,以便下次评论时使用。
Δ
0 条评论。