php: What's the equivalent int()
function for bigint type? (int()
cuts big numbers to 2147483647)?
Example:
$bigint1="12312342306A_C243";
$bigint1=(int)$bigint1;//2147483647
but I want it to be 12312342306.
I know is old and answered, but for future reference of people looking at this:
UPDATED
The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that's 32 bits signed). 64-bit platforms usually have a maximum value of about 9E18, except on Windows prior to PHP 7, where it was always 32 bit. PHP does not support unsigned integers. Integer size can be determined using the constant PHP_INT_SIZE, maximum value using the constant PHP_INT_MAX since PHP 5.0.5, and minimum value using the constant PHP_INT_MIN since PHP 7.0.0.