Home > Backend Development > PHP Tutorial > 这个该如何写?

这个该如何写?

WBOY
Release: 2016-06-13 10:28:46
Original
937 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