PHP から JSON を作成する必要があります。JSON の構造は単純ではありません。
{
"new" : {
"checkpoints" :
[
{
"id" : "businessidea",
"name" : "business idea",
"purpose" : "Form a business idea",
"customer" :
{ "questions" :
[
{ "questionid" : "id1", "questiontitle": "Evaluate size of the market, likely growth vectors and estimate addressable size.", "answers" :
[
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]},
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]},
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]}
]
},
{ "questionid" : "id2","questiontitle": "Define the needs of the customers and the value we will deliver to the customers - customer pain and our solution", "answers" :
[
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]},
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]},
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]}
]
},
{ "questionid" : "id3","questiontitle": "Define the competitor landscape" , "answers" :
[
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]},
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]},
{"answertext" : "an answer here", "answerlink": "", "answers": [
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"},
{"answertext": "answer text here", "answerlink": "http://google.com"}
]}
]}
]
},
これを達成するための最良の方法は何ですか?多くの文字列連結を使用してこの json を構築するルートをたどりますか、それとも PHP の組み込み JSON ツールを使用することは可能ですか?