php json encode - 数组键不输出为字符串

阅读 134

2022-10-31


  So I have a php array like this:

  I would like to output this array in json_encoded form with the array keys as object names(?).

  When I the array I get this:

  The trouble with this is that the array keys ("name" and "data") are output as strings. I need them to be objects. I.e. without the quotes around them.

  EDIT:

  The purpose is this is to build and use a php array with highcharts. As can be seen in the source of this chart the data is passed in that way:

  Is this json or another way of forming javascript objects?

精彩评论(0)

0 0 举报