php - How to fetch phone numbers from string? -


this question has answer here:

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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -