我有第三方供应商提供的多维数组,详细信息如下。
$数据 = 数组 (
“学生数据” => 数组(
大批(
“大学” => 数组(
"名称" => "测试名称",
"地址" => "街道名称",
"省" => "省名",
),
“大学” => 数组(
“名称” => “它”
),
"考试日期" => "2019-01-20",
“课” =>
大批(
“课程编号”=>
大批(
“课程编号”=>“40”
)
),
"countStudent" => "2",
“考试成绩” =>
大批(
大批(
"学生性别" => "男",
“学生姓名” =>
大批(
大批(
"名字" => "乔治",
“结果” => “98”
),
大批(
"名字" => "伦纳德",
“结果” => “84”
),
),
)
)
),
大批(
“大学” => 数组(
"名称" => "测试名称",
"地址" => "街道名称",
"省" => "省名",
),
“大学” => 数组(
“名称” => “它”
),
"考试日期" => "2019-01-20",
“课” =>
大批(
“课程编号”=>
大批(
"课程编号" => "41"
)
),
"countStudent" => "1",
“考试成绩” =>
大批(
"学生性别" => "女性",
"考试日期" => "2019-01-20",
“课程编号” => 数组(
“课程编号”=>“40”
),
"countStudent" => "1",
“学生姓名” =>
大批(
大批(
"名字" => "安妮塔",
“结果”=>“71”
)
),
)
),
大批(
“大学” => 数组(
"名称" => "测试名称",
"地址" => "街道名称",
"省" => "省名",
),
“大学” => 数组(
“名称” => “设计图形”
),
"考试日期" => "2019-01-20",
“课” =>
大批(
“课程编号”=>
大批(
“课程编号”=>“42”
)
),
"countStudent" => "3",
“考试成绩” =>
大批(
大批(
"学生性别" => "男",
“学生姓名” =>
大批(
大批(
"名字" => "爱德华",
“结果”=>“83”
),
大批(
"名字" => "威廉",
“结果”=>“86”
),
大批(
"名字" => "奥利弗",
“结果”=>“77”
),
),
)
)
),
大批(
“大学” => 数组(
"名称" => "测试名称",
"地址" => "街道名称",
"省" => "省名",
),
“大学” => 数组(
“名称” => “设计图形”
),
"考试日期" => "2019-01-20",
“课” =>
大批(
“课程编号”=>
大批(
“课程编号”=>“42”
)
),
"countStudent" => "2",
“考试成绩” =>
大批(
大批(
"学生性别" => "女性",
“学生姓名” =>
大批(
大批(
"名字" => "伊莎贝尔",
“结果”=>“77”
),
大批(
"名字" => "多萝西",
“结果”=>“86”
)
),
),
)
),
),
“课程数据” => 数组(
大批(
“课程编号” => 数组(
“课程编号”=>“40”
),
"sessionName" => "PHP 和数组",
“教师数据”=> 数组(
"teacherName" => "老师姓名一",
"teacherId" => "229910",
),
),
大批(
“课程编号” => 数组(
"课程编号" => "41"
),
"sessionName" => "Photoshop",
“教师数据”=> 数组(
"teacherName" => "老师名二",
"teacherId" => "981881",
),
),
大批(
“课程编号” => 数组(
“课程编号”=>“42”
),
"sessionName" => "Coreldraw",
“教师数据”=> 数组(
"teacherName" => "老师名三",
"teacherId" => "327718",
),
)
),
);
我必须根据场景中的“lessonData”标签中的每个“lessonIdNumber”修改上述数组的结果:将[sessionName]和[teacherData]的值从[lessonData]移到[studentData]数组中的每个[lesson]下面[课程编号]。
大批
(
[学生数据] => 数组
(
[0] => 数组
(
[大学] => 数组
(
[名称] => 测试名称
[地址] => 街道名称
[省] => 省名
)
[college] => Array
(
[name] => IT
)
[examDate] => 2019-01-20
[lesson] => Array
(
[lessonId] => Array
(
[lessonIdNumber] => 40
)
)
[sessionName] => PHP and Array
[teacherData] => Array
(
[teacherName] => Teacher Name One
[teacherId] => 229910
)
[countStudent] => 2
[examResult] => Array
(
[0] => Array
(
[studentGender] => Male
[studentName] => Array
(
[0] => Array
(
[name] => George
[result] => 98
)
[1] => Array
(
[name] => Leonard
[result] => 84
)
)
)
)
)
[1] => Array
(
[university] => Array
(
[name] => Tes Name
[address] => Street name
[province] => Province name
)
[college] => Array
(
[name] => IT
)
[examDate] => 2019-01-20
[lesson] => Array
(
[lessonId] => Array
(
[lessonIdNumber] => 41
)
)
[sessionName] => Photoshop
[teacherData] => Array
(
[teacherName] => Teacher Name Two
[teacherId] => 981881
)
[countStudent] => 1
[examResult] => Array
(
[studentGender] => Female
[examDate] => 2019-01-20
[lessonId] => Array
(
[lessonIdNumber] => 40
)
[countStudent] => 1
[studentName] => Array
(
[0] => Array
(
[name] => Anita
[result] => 71
)
)
)
)
[2] => Array
(
[university] => Array
(
[name] => Tes Name
[address] => Street name
[province] => Province name
)
[college] => Array
(
[name] => Design Graphics
)
[examDate] => 2019-01-20
[lesson] => Array
(
[lessonId] => Array
(
[lessonIdNumber] => 42
)
)
[sessionName] => Coreldraw
[teacherData] => Array
(
[teacherName] => Teacher Name Three
[teacherId] => 327718
)
[countStudent] => 3
[examResult] => Array
(
[0] => Array
(
[studentGender] => Male
[studentName] => Array
(
[0] => Array
(
[name] => Edward
[result] => 83
)
[1] => Array
(
[name] => William
[result] => 86
)
[2] => Array
(
[name] => Oliver
[result] => 77
)
)
)
)
)
[3] => Array
(
[university] => Array
(
[name] => Tes Name
[address] => Street name
[province] => Province name
)
[college] => Array
(
[name] => Design Graphics
)
[examDate] => 2019-01-20
[lesson] => Array
(
[lessonId] => Array
(
[lessonIdNumber] => 42
)
)
[sessionName] => Coreldraw
[teacherData] => Array
(
[teacherName] => Teacher Name Three
[teacherId] => 327718
)
[countStudent] => 2
[examResult] => Array
(
[0] => Array
(
[studentGender] => Female
[studentName] => Array
(
[0] => Array
(
[name] => Isabel
[result] => 77
)
[1] => Array
(
[name] => Dorothi
[result] => 86
)
)
)
)
)
)
)
我希望我的问题很清楚并得到解决。谢谢您的帮助。