i have this problem:
- i am using code igniter and mysql DB to view/store my datas, they are quotation of gold coins. They are stored like a pair of (date,value)
- with codeIgniter i am able to get them from mysql, but the date are in a form like "2011-11-03"
My code is something like:
- Code: Select all
$data = array();
foreach($golds as $single)
{
$value = $single->Value; // value is 287.15, correct
$dateStr = ($single->Data); // here is "2011-11-03" correct!
$dateTime = floatval ( strtotime($dateStr) ) ; // here is 1320274800 correct!
$dateTimeEn = ($dateTime)*1000; // here is 1320274800000 correct!
$data[($dateTimeEn)] = ($value);
}
print_r ($data);
Array ( [1719840128] => 287.15 ETC... // WRONG!!! 1719840128 is not 1320274800000
I know that i have to multiply by 1000 the epoch time that i get from the method strtotime
the problem is that the value multiplied by 1000 exceed the limit of php ...so i am not able to build a correct array ( i have things weird like negative keys...)
How to solve it?
Thanks in advance!
Giuseppe