"> ">

get country code from phone number php from string format

<?php
 $user_phone = "+919555699081";
 $len = strlen($user_phone);
 $phone = substr($user_phone, -10);
 $country_code = substr($user_phone, 0,$len -  strlen($phone));
 echo $country_code."-".$phone."-"; echo $user_phone; 
?>

Discover more from Soa Technology | Aditya Website Development Designing Company

Subscribe to get the latest posts sent to your email.



Leave a Reply

Discover more from Soa Technology | Aditya Website Development Designing Company

Subscribe now to keep reading and get access to the full archive.

Continue reading