
CCK have regitsered all the number prefix used in Kenya. Check on their site. On Sun, Jul 24, 2011 at 10:10 PM, Michael Pedersen <sku@kaal.dk> wrote:
Hi everyone,
I'm trying to create some code to validate/sanitize mobile phone numbers entered by users, for use with SMS gateways.
So far I have the following:
729974802 becomes: 254729974802 0729974802 becomes: 254729974802 0 729 974 802 becomes: 254729974802 254 729974802 becomes: 254729974802 +254 729974802 becomes: 254729974802 (254) 7 29974802 becomes: 254729974802 +(254) 7 29974802 becomes: 254729974802 (+254) (0) 7 29974802 becomes: 254729974802
However I am not sure that I have captured all the different ways that a Kenyan mobile-phone number could be entered. So the question to you all is: are there more ways a number could be entered ?
n.b. if anyone is interested the code for the above is (in php): $phone = '254' . preg_replace('/^\+?(\(?\+?254\**)?)?(\(?0\)?)?7/', '7', str_replace(' ', '', $input));
.. Mike
______________________________**_________________ Skunkworks mailing list Skunkworks@lists.my.co.ke http://lists.my.co.ke/cgi-bin/**mailman/listinfo/skunkworks<http://lists.my.co.ke/cgi-bin/mailman/listinfo/skunkworks> ------------ Skunkworks Rules http://my.co.ke/phpbb/**viewtopic.php?f=24&t=94<http://my.co.ke/phpbb/viewtopic.php?f=24&t=94> ------------ Other services @ http://my.co.ke
-- Jackson Gathoni