开发者

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

开发者 https://www.devze.com 2022-12-12 19:09 出处:网络
I\'ve been 开发者_运维百科using \"/x{201C}/u\" and \"/x{201D}/u\" to match them, but there\'s no result.

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

精彩评论

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