开发者

How do I look for “ and ” in php using preg_match?

I've been 开发者_运维百科using "/x{201C}/u" and "/x{201D}/u" to match them, but there's no result.

Am I doing something wrong??


I've been using "/x{201C}/u" and "/x{201D}/u" to match them, but there's no result.

You need to type "/\x{201C}/u" and "/\x{201D}/u"


Oh.. shoot! that's a stupid question... '|“|' and "|”|" works!


Have you tried

\x8c and \x9d

Those have worked for me.


if your requirement is that simple as just finding double quotes, just use PHP's string methods

$str='mystring_with_"_blah';
if ( strpos($str,'"') !==FALSE){
    print "Found double quotes\n";
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜