我有一个由表单数据组成的多维数组,看起来像这个例子:
array [
"absender" => "Maxim Ivan",
"email" => "maximivan@example.com",
"telefon" => "1234567890",
"fax" => null,
"grund" => "Gehaltserhöhung",
"termin" => [
0 => [
"person" => "Some Name",
"meeting" => "10.05"
],
1 => [
"person" => "Another Name",
"meeting" => "18.05"
],
2 => [
"person" => "Again another name",
"meeting" => null,
"next-possible-meeting" => "1"
],
3 => [
"person" => "And again",
"meeting" => null,
"next-possible-meeting" => "1"
],
4 => [
"meeting" => null,
],
"bemerkung" => "some notes by Maxim"
]
“个人”和“下一次可能的会议”是复选框,而“会议”是文本区域。当“人员”存在时,我只需要“ termin”数据,因此我将它们分别存储在不同的数组中(一个用于人员,一个用于会议,另一个用于下一次会议)。
这意味着我不再需要嵌套该数组,可以(并且应该)从其中删除“ termin”。但是我不知道如何正确访问嵌套数组。
如何从整个数组中删除整个“ termin”数组,从而使其成为普通数组而不是多维数组?
答案 0 :(得分:3)