でJSONオブジェクトからのデータガイド:は、私はPHPのAPIからこのオブジェクトを持っているのJavaScript
[Object { span=1, caption="Particular", master=true},
Object { span=5, caption="Loan Class 1"},
Object { span=5, caption="Loan Class 2"},
Object { span=5, caption="Loan Class 3"}]
所望の出力は次のようになります。
## Particular Loan Class 1 Loan Class 2 Loan Class 3 ##
は、私はこれを実行しようとしました:
var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData;
for (var index in arrData[0]) {
row += index + ',';}
row = row.slice(0, -1);
CSV += row + '\r\n';
csvの外観
## span caption master ##
キャプション値を取得する方法と、列のマージを追加する必要があるため、Excelでこれを出力するスクリプトがある場合は助けてください。
print_rの出力ではなくJSONを表示します。 –