Yesterday I asked a question about mining, to which I was kindly answered. However, I am observing some strange behavior and would like to understand what is happening.
In my php, I have an array that I send back to the javascript web client program that uses it.
In php
sendBack = null;
sendBack[0]['TimeStamp'] = $Time;
sendBack[0]['Text'] = $Message;
sendBack[1]['TimeStamp'] = 0;
sendBack[1]['Text'] = $MessageAdmin;
echo json_encode($sendBack);
In js, I will unpack it for use with:
var json = eval('(' + data + ')');
The problem is that the TimeStamp time index in js is processed as a string, but the index 1 index index is processed as int.
From an educational point of view, does anyone know what is going on?
source
share