My question it will be easy i assume>>>
I have mobile number, I want to minimize the output number from 15 digits upto only 12 digits by printing first 12 one's
(e.x $mobile= 966598383838332 I want to print just like this $mobile= 966598383838 ) first 12!
I want to sed sms for this number but with only 12 digits>>>
1) I tried to use substr() but isn't working because it will deal with number as string which is not acceptable
2) I tried to get this value back to integer by using $mobileback = (int)$mobile but it changes the digits to other one
here my code
<?php
include("function.php");
/*$mobile = $_POST['mobileNumber'];*/
$message = $_POST['message'];
$mobile= $_POST['mobileNumber'];// mobile number after decryption = 966598393238??? // last three digits is unknow character??
$mobil = substr((int)$mobile, 0, 11);//this function will print first number in this string up to last one in string -3 but as integer will be convert to string !!!!!
//it will print 2147483647
echo $mobileNum;// this will print number which is string not exist integer any more
$num = (int)$mobil;// I use this function to convert string to be integer ,but once i did this, I get other number not orginal one.?
echo $num;// this is just an example to see different
$sendsms = sendToMobile( $num, "TakeAway.Com", $message );
?>
this code didn't work to send sms cause of this problem I want to minimize mobile number to get value of first 12
This post has been edited by csboss: 11 February 2009 - 08:30 AM

New Topic/Question
Reply




MultiQuote




|