首頁 > 後端開發 > php教程 > 输出数组给js用的有关问题

输出数组给js用的有关问题

WBOY
發布: 2016-06-13 11:36:41
原創
915 人瀏覽過

输出数组给js用的问题

<br /> data = [{<br />y: 100,<br />color: colors[0],<br />drilldown: {<br />name: 'MSIE versions',<br />categories: ['MSIE 6.0', 'MSIE 7.0', 'MSIE 8.0', 'MSIE 9.0'],<br />data: [10.85, 7.35, 33.06, 2.81],<br />color: colors[0]<br />}<br />}, {<br />y: 21.63,<br />color: colors[1],<br />drilldown: {<br />name: 'Firefox versions',<br />categories: ['Firefox 2.0', 'Firefox 3.0', 'Firefox 3.5', 'Firefox 3.6', 'Firefox 4.0'],<br />data: [0.20, 0.83, 1.58, 13.12, 5.43],<br />color: colors[1]<br />}<br />}, {<br />y: 11.94,<br />color: colors[2],<br />drilldown: {<br />name: 'Chrome versions',<br />categories: ['Chrome 5.0', 'Chrome 6.0', 'Chrome 7.0', 'Chrome 8.0', 'Chrome 9.0',<br />'Chrome 10.0', 'Chrome 11.0', 'Chrome 12.0'],<br />data: [0.12, 0.19, 0.12, 0.36, 0.32, 9.91, 0.50, 0.22],<br />color: colors[2]<br />}<br />}, {<br />y: 7.15,<br />color: colors[3],<br />drilldown: {<br />name: 'Safari versions',<br />categories: ['Safari 5.0', 'Safari 4.0', 'Safari Win 5.0', 'Safari 4.1', 'Safari/Maxthon',<br />'Safari 3.1', 'Safari 4.1'],<br />data: [4.55, 1.42, 0.23, 0.21, 0.20, 0.19, 0.14],<br />color: colors[3]<br />}<br />}, {<br />y: 2.14,<br />color: colors[4],<br />drilldown: {<br />name: 'Opera versions',<br />categories: ['Opera 9.x', 'Opera 10.x', 'Opera 11.x'],<br />data: [ 0.12, 0.37, 1.65],<br />color: colors[4]<br />}<br />}]; <br /><br />
登入後複製

以上是javascript原本的数组

<br />data = [{"y":673,"color":"colors[0]","drilldown":{"name":"AMZ_AC \u660e\u7ec6","categories":["DE","ES","FR","GB","IT"],"data":["28","2","410","211","22"],"color":"colors[0]"}},{"y":290,"color":"colors[1]","drilldown":{"name":"AM_AC \u660e\u7ec6","categories":["JP"],"data":["290"],"color":"colors[1]"}},{"y":222,"color":"colors[2]","drilldown":{"name":"CO_AC \u660e\u7ec6","categories":["JP"],"data":["222"],"color":"colors[2]"}}];<br />
登入後複製

以上是我用PHP输出的数组

请问这两个哪里不一样啊??输出产生的结果跟原来的结果差好远

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板