PHP array_diff not working

前端 未结 4 517
孤街浪徒
孤街浪徒 2021-01-04 12:56

I\'m trying to use array_diff like so. Here are my two array outputs:

List 1 Output

Array ([0] => 0022806 ) 

List 2 Output

4条回答
  •  轮回少年
    2021-01-04 13:37

    Per the documentation, the values of the second array are subtracted from the first one. Or, to put it another way, you start with the first array, and then remove all the values that appear in the second array. That would correctly yield an empty array that you see above

    You might want to play around with intersection, that might help you get what you want.

提交回复
热议问题