Last active
October 31, 2018 23:58
-
-
Save Kendysond/e13dd93ea605fdec9edaae428a0f7f25 to your computer and use it in GitHub Desktop.
Clean any Nigerian Number format to be ready for sending SMS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clean_number($phone_number){ | |
$phone_number = preg_replace('/^0/','234',$phone_number); | |
$phone_number = preg_replace('/^\+/','',$phone_number); | |
return $phone_number; | |
} | |
// This should convert a number like 09023293092 or +2349023293092 to 2349023293092 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment