Skip to content

Instantly share code, notes, and snippets.

@Kendysond
Last active October 31, 2018 23:58
Show Gist options
  • Save Kendysond/e13dd93ea605fdec9edaae428a0f7f25 to your computer and use it in GitHub Desktop.
Save Kendysond/e13dd93ea605fdec9edaae428a0f7f25 to your computer and use it in GitHub Desktop.
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