PHP 用正则表达式取双引号内的内容
( 更新:02-20 加入收藏)
案例:
河北省石家庄市
运行结果:<?php
$str = 'a:1:{i:609;s:15:"河北省石家庄市";}';
$pattern = '#"(.*?)"#i';
preg_match_all($pattern, $str, $matches);
print_r($matches[1][0]);
?>
河北省石家庄市