Pouring a number from a string in int will change the value in php

I am 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 that accepts this parameter as a whole. Therefore, I need to specify type c (int), but this work will change the parameter value for example, something like this:

$o =  4924869620;
$c = (int) $o;

then c will matter 629902324

Why is this happening? how can i keep the value the same? I also used intval()and it will also change the meaning

+3
source share
5 answers

The range of integers starts at -2.147.483.648 and ends at 2.147.483.647 - your number is greater than the maximum range. Use a different data type, such as float.

Float , 1.5E-45 3.4E38; o)

+3

, 32- , , int 4294967295 float instad:

$c = (float) $o;
+4

, int. float double.

+3

float. , ? ( , 4- , , ).

+2

(float) $o;, 4924869620 . , , , , url, ​​ ...

0

All Articles