这里我有时间戳值
$user_array1[] = $val['timestamp'];
$graph_data1 ='';
if(is_array($user_array1))
{
$graph_data1 = implode(',',$user_array1);
}
i print_r($graph_data1);
我得到了
,2014-05-26 00:43:45,2014-05-26 00:43:52,2014-05-26 00:43:592014-05-26 00:43:19,2014-05-26 00:43:24,2014-05-26 00:43:27,2014-05-26 00:43:30,2014-05-26 00:43:34,2014-05-26 00:43:37,2014-05-26 00:43:41,2014-05-26 00:43:45,2014-05-26 00:43:52,2014-05-26 00:43:59,2014-05-26 00:44:11
Highchart方面:
categories: [<?php echo $graph_data1 ?> ]
它没有显示任何东西。
答案 0 :(得分:0)
在您当前的数据格式中,您的字符串被视为格式错误,因此在高图中输入不正确。你必须正确格式化拳头。考虑这个例子:
$graph_data1 = "'".implode("','", $user_array1)."'";
应输出如下内容:
&#39; 2014-05-26 00:43:45&#39;,&#39; 2014-05-26 00:43:45&#39;,&#39; 2014-05-26 00: 43:45&#39; ......等......