开发者

single quote replacement problem in php

I need a regular expression patter which similar to this

$pattern ="/[^\w]/";  

But it should hide html syntax.

$string = preg_replace($开发者_开发技巧pattern,'',$str);


I am not one hundred pourcent sure about what you mean by "hide HTML syntax" but if your content is some html and you want to strip out the html tags use strip_tags function.

so in your example:

$pattern ="/[^\w]/"; 
$string = preg_replace($pattern,'',html_entity_decode(strip_tags($str)));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜