Array1:
ID: 1
ID: 2
ID: 3
ID: 4
ID: 5
Array2, with num value:
ID: 2, NUM: 200
ID: 4, NUM: 400
I want the output like: (adding zero if no record in array2)
ID: 1, NUM: 0
ID: 2, NUM: 200
ID: 3, NUM: 0
ID: 4, NUM: 400
ID: 5, NUM: 0
I am new to PHP, tried array_diff and array_intersect but not find the clue, could you please let me know how can I do that?
Thanks.
0 comments:
Post a Comment
Thanks