I’m working on a project in PHP, and trying to use one of the parameters in $_POST, unfortunately I want to send the result to a web service, which only accepts the parameter as integer. So I have to cast the type with (int) but this work will change the value of parameter
for instance its something like this:
$o = 4924869620;
$c = (int) $o;
then c will have the value 629902324
Why this thing happen? how can I keep the value the same?? I have also used intval() and it will also change the value
Integers range starts at −2.147.483.648 and ends at 2.147.483.647 – your number is bigger than the maximal range. Use another datatype, for example float, instead.
Float has a range that starts at 1.5E-45 and goes to 3.4E38 ;o)