Я выполнил шаги, указанные в этом ответе в PHP.
Однако я хотел бы добавить элементы в array_answer
следующим образом:
[
{
"id": "4c42ff61-148c-11e9-b673-005056be36b2",
"answer": "1",
"id_question": "11",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "59a09a34-148c-11e9-b673-005056be36b2",
"answer": "3",
"id_question": "12",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "66774e30-148c-11e9-b673-005056be36b2",
"answer": "3",
"id_question": "14",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "9469c0e4-148c-11e9-b673-005056be36b2",
"answer": "1",
"id_question": "10",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
}
]
и array_question
:
[
{
"id": "10",
"question": "Shop sign/billboard"
},
{
"id": "11",
"question": "Pylon"
},
{
"id": "12",
"question": "Banner"
},
{
"id": "13",
"question": "Sport"
},
{
"id": "14",
"question": "Matic"
},
{
"id": "16",
"question": "Cub"
}
]
и результат (array_result
):
[
{
"id": "10",
"question": "Shop sign/billboard",
"answer":"1",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "11",
"question": "Pylon",
"answer" : "1",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "12",
"question": "Banner",
"answer": "3",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "13",
"question": "Sport",
"answer" : null,
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "14",
"question": "Matic",
"answer": "3",
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
},
{
"id": "16",
"question": "Cub",
"answer" : null,
"pi": null,
"ca": null,
"pic": null,
"new_deadline": null,
"reason": null,
"notes": null,
"deadline": null
}
]
В приведенном мной примере только 1 элемент из array_answer
введен в array_result
, а именно answer
, теперь я хочу добавить pi
, ca
, pic
, deadline
, new_deadline
, reason
и notes
. Как мне это сделать? Я не понимаю, пожалуйста, помогите мне ..
Thankyou ..