这个该如何写?

WBOY
Release: 2016-06-13 13:26:50
Original
825 people have browsed it

这个该怎么写??
$a = '+86-021-13512345678转(0755)82382022&a0755-99999999mp;nb+8613812345678sp; 82382044/34';

preg_match_all('/[\d\()\+\-\s]+/',$a,$r);

print_r($r);

现在已经能提取数字了。。可是怎么能限制下,区号是3位数呀,后边电话位数是8位的呢??

------解决方案--------------------
是要限制还是要取。。。要取0755的075?还是755?

\d\d{3}-\d{8} 

\d{3}\d-\d{8}

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!