post - php double overflow problem -


i'm sure quite simple can't find answer.

i'm passing double php page, , retrieving code:

$timestamp = $_post['timestamp']; 

the number being passed (1291328282) gets changed -1456872199 php script. code:

$timestamp = (float) $_post['timestamp']; 

has same result.

there no difference in php. 'float', 'double' or 'real' same datatype.

$_post['timestamp']; if has value of 1291328282 not double, int, looks unix_timestamp not confused epoch.

im not sure wish achive think want:

$timestamp = (int)$_post['timestamp']; 

little knowledge:

when converting float string trailing zeros dropped.

example (5.3.^)

echo (string)5.00500; // outputs 5.005 echo (string)30.0000; // outputs 30 

what want is:

$timestamp = abs((int)$_post['timestamp']); 

Comments