Skip to content

Instantly share code, notes, and snippets.



Last active Oct 31, 2018
What would you like to do?
Clean any Nigerian Number format to be ready for sending SMS
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