摘要:
$string = "13826589549";$pattern = "/(\d{3})\d\d(\d{2})/";$replacement = "\$1****\$3"; print preg_replace($pattern, $replacement, $string);输出的结果:138****9549这个匹配结果是我想要的,但是这个匹配模式是错误的,它只能匹配7个,剩余4个数字匹配不到,就显示出来了,还有\$3根本就不存在正确的写法应该是$string = "13826589549";$pattern = 阅读全文
posted @ 2012-09-03 16:37 陈达辉 阅读(434) 评论(0) 推荐(0) 编辑