【问题标题】:Php 2D array into javascript array in highcharts [duplicate]在highcharts中将Php 2D数组转换为javascript数组[重复]
【发布时间】:2014-07-03 15:13:00
【问题描述】:

我在 php 中有一个二维数组

Array ( [0] => Array ( [date] => 16/06/2014 [total_booking] => 2 ) [1] => Array ( [date] => 16/06/2014 [total_booking] => 1 ) [2] => Array ( [date] => 16/06/2014 [total_booking] => 1 ) [3] => Array ( [date] => 17/06/2014 [total_booking] => 1 ) [4] => Array ( [date] => 18/06/2014 [total_booking] => 1 ) [5] => Array ( [date] => 18/06/2014 [total_booking] => 1 ) ) 

我想在 highcharts 中将此数组用作 x 轴中的日期和 y 图表中的总预订量, 如何将此数组转换为javascript数组。请帮助。

【问题讨论】:

标签: javascript php arrays highcharts


【解决方案1】:

在发送到 javascript 之前使用json_encode($array);

【讨论】:

  • 能否详细说明如何在highcharts.ie中使用这个json; xaxis 中的日期和 yaxis 中的 total_booking
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-08-15
  • 1970-01-01
  • 2018-03-18
  • 1970-01-01
  • 2016-03-25
  • 2018-12-16
  • 1970-01-01
相关资源
最近更新 更多