I’m sure this is quite simple but I can’t find the answer.
I’m passing a double into a PHP page, and retrieving it with the code:
$timestamp = $_POST['timestamp'];
The number being passed (1291328282) gets changed into -1456872199 by the PHP script. The code:
$timestamp = (float) $_POST['timestamp'];
has the same result.
There is no difference in PHP. ‘float’, ‘double’ or ‘real’ are the same datatype.
$_POST['timestamp'];if has the value of1291328282is not a double, but anint, it looks like aUNIX_TIMESTAMPnot to get confused with EPOCH.Im not sure what you wish to achive but i think you want:
Little extra knowledge:
When converting from float to string trailing zeros will be dropped.
Example (5.3.^)
What you want to do is: