I have a strange problem relating to a PHP array, that I am struggling to diagnose. I have a script that reads temperatures from a SQL db and then displays them via PHPgraphlib. I take the unix epoch time stamp from the database query and convert into human readable form. This is used as a key in the array that stores the temperatures. So, in summary I have the following in a loop
$unix_time = $row['DATE_TIME'];
$human_date = date("md.h:i",$unix_time);
$temp_array[$human_date] = $row['CURRENT_TEMP'];
I then display the results, using phpgraphlib:-
$graph->addData($temp_array);
This displays the temperatures on the y axis vs the human readable timestamps on the x.
This seems to work fine, until 12 midday, when it stops displaying data with a timestamp after 1200, it then restarts after 0000. Which is very strange. Similarly, if I just use the unix epoch timestamp (something like 1459799541) as the key, do data is displayed.
Is there a limit to the length of the key that I am excessing after midday/with the long unix epoch time? Any help greatly appreciated!
phpgraphlib, buthis 1-12 so 12 noon and 12 midnight are the same as are all of the other AM and PM times. This makes duplicate keys which are not allowed. Try usingHfor 24 hour time and see if it works.