السلام عليكــم ورحمـة الله وبركاتــه
اخواني الاعزاء سؤال سريع جداً
اريد دالة او طريقة تقوم بأخذ أول 12 رقم من رقم جوال مكون من 15 خانة ، اقول رقم ماهو string
لاني جربت استخدم ( )substr ولكنها خاصة بالـstring وامضبطت
قمت بعد كذا بتحويل هذا الـstring الـ int بالستخدام
mobile= (int)$mobile$
كيف اسوي نفس الشيء بس للجوال اقصد integer
هذا كودي
<?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