php - How to fetch phone numbers from string? -
this question has answer here:
- php regex, extract phone numbers string? 3 answers
i have string whom fetch database having different format how can fetch phone numbers strings
string examples
user name;foo@foo.com;0373xxxxxx;fooo;ccc user name;foo@foo.com;fooo;0373xxxxxx;ccc user name;0373xxxxxx;foo@foo.com;fooo;ccc
and here 0373xxxxxx 10 digit phone number of user
use below code :
<?php $string = "user name;foo@foo.com;0373123456;fooo;ccc"; preg_match_all('!\d+!', $string, $matches); print_r($matches); ?>
hope :)
Comments
Post a Comment