I have two arrays:
1. first array:
array
0 =>
array
'id' => int 1
'section_id' => int 2
'class_id' => int 25
'student_id' => int 1
'unixdate' => int 1322553600
'date' => string '2011-11-29' (length=10)
'attendance' => string 'present' (length=7)
1 =>
array
'id' => int 2
'section_id' => int 2
'class_id' => int 25
'student_id' => int 2
'unixdate' => int 1322553600
'date' => string '2011-11-29' (length=10)
'attendance' => string 'absent' (length=6)
2. second array:
array
0 =>
array
'section_id' => int 2
'class_id' => int 25
'student_id' => int 1
'unixdate' => int 1322553600
'date' => string '2011-11-29' (length=10)
'attendance' => string 'absent' (length=7)
1 =>
array
'section_id' => int 2
'class_id' => int 25
'student_id' => int 3
'unixdate' => int 1322553600
'date' => string '2011-11-29' (length=10)
'attendance' => string 'absent' (length=6)
ON these array if values of two keys ‘student_id’ and ‘unixdate’ matches I want new array with the id from array one and other from array 2.
OR
replace the ‘attendance’ value to first array if ‘student_id’ and ‘unixdate’ of both array are same.
EDIT
my result should be like this:
array
0 =>
array
'id' => int 1
'section_id' => int 2
'class_id' => int 25
'student_id' => int 1
'unixdate' => int 1322553600
'date' => string '2011-11-29' (length=10)
'attendance' => string 'absent' (length=7)
How can i do this?
did you try with 2 foreach?