So I have this simple code:
$var = abs(crc32('string - 8 characters')).rand(100,999);
var_dump($var);
echo '<br>';
var_dump((int)$var);
echo '<br>';
var_dump(intval($var));
And the result:
string(13) "2047654753402"
int(2147483647)
int(2147483647)
Why the integer value is 2147483647? I expected it to be 2047654753402. I just want to convert the string to integer without changing the value.
Why the integer value is 2147483647?Because2147483647is the maximum value that can be stored in a 32-bit signed integer