I have two array students and marks . Need a output array like marks_sheet.Delete all data which is not present in marks array and insert a new field marks. // name of this array students
Array
(
[0] => Array
(
[userId] => user1
[name] => Suman Mandal
[age] => 20
)
[1] => Array
(
[userId] => user2
[name] => Amit Halder
[age] => 30
)
[2] => Array
(
[userId] => user3
[name] => Asif Rahman
[age] => 25
)
[3] => Array
(
[userId] => user4
[name] => Gopal Ghosh
[age] => 21
)
)
// name of this array marks
Array
(
[0] => Array
(
[userId] => user1
[marks]=>80
)
[1] => Array
(
[userId] => user3
[marks]=>90
)
)
I need a output like this: // name of this array marks_sheet
Array
(
[0] => Array
(
[userId] => user1
[name] => Suman Mandal
[age] => 20
[marks]=>80
)
[1] => Array
(
[userId] => user3
[name] => Asif Rahman
[age] => 25
[marks]=>90
)
)
I have a little knowledge on php. May be this is so easy but I am feeling hard to solve it... please help me
Check this link you must get you solution – mukesh kumar Nov 03 '18 at 18:02