Get the difference between two arrays.

array:difference(ARRAY $first_array, ARRAY $second_array) : ARRAY

$first_array = [
    1,2,3,4,5,6
]
$second_array = [
    1,2,3,4,5
]

array:difference($first_array, $second_array)
#=> [
#=>     5 => 6
#=> ]

#===
$first_array = [
    [1],[2]
]
$second_array = [
    [1]
]
array:difference($first_array, $second_array)
#=> ERROR: array_difference_invalid_array -- Array difference does not accept multi dimensional array.

Copyright ©2013-2022 SunSed®. All rights reserved.