Thursday, July 19, 2012

Remove all alpha-numeric characters from a phone number

Hi Friends,

To remove all alpha-numeric characters from a phone number.. in php simple one line code..


$phoneStr = "+91-23223-24232";

$phone = preg_replace('/\D+/', '', $phoneStr  );


resulted phone number will be plain number like 912322324232


Enjoy!!!
Ravi

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.