php正则表达 去除非数字

WBOY
Release: 2016-06-13 13:26:49
Original
744 people have browsed it

求一个php正则表达 去除非数字
求一个正则额 去除非数字 比如:
"a1asd2asd3a"
正则过滤后 输出
123

不要intval()或者(int)之类的 因为大于10位数就不行了
谁先回复正确 分送你

------解决方案--------------------
echo preg_replace('/\D/','','a1asd2asd3a');

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!