Sometimes it is necessary to convert the mobile phone number into an integer calculation, if it is a string, the calculation is wrong.
But the phone number is 11 digits, direct (int) or (integer) will overflow because it exceeds the boundary.
Int can't be float. .
$num = (float)$phone_num % 99 + 1;
或
$phone_num = $phone_num +0;
$num = $phone_num % 99 + 1;
当浮点类型过大会出现负数等问题,如下即可解决
$num = intval(fmod(floatval($phone_num), 99));