soundsticks Posted March 26, 2013 Share Posted March 26, 2013 How to add country code if user doesn't enter the country code when they register? If user did enter the country code it will skip and store it into database, if user doesn't enter then system will add the country code and store to database. How can I do that? Link to comment https://forums.phpfreaks.com/topic/276160-how-to-add-country-code-after-user-insert-their-mobile-number/ Share on other sites More sharing options...
haku Posted March 26, 2013 Share Posted March 26, 2013 How do you intended to determine their country code if they don't enter one? Link to comment https://forums.phpfreaks.com/topic/276160-how-to-add-country-code-after-user-insert-their-mobile-number/#findComment-1421078 Share on other sites More sharing options...
soundsticks Posted March 27, 2013 Author Share Posted March 27, 2013 I have done in this way. if (preg_match('/^01/', $_POST['mobile'])) { ... } elseif (preg_match('/^60/', $_POST['mobile'])) { ... } Link to comment https://forums.phpfreaks.com/topic/276160-how-to-add-country-code-after-user-insert-their-mobile-number/#findComment-1421325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.