Posts tagged with “php”

PHP array_merge array_diff array_intersect function c# alternative

If you've got LINQ available to you, you can use Union, Except, Intersect, and Distinct:

  • array1.Union(array2).Distinct().ToList()
  • array2.Except(array1)
  • array1.Except(array2)
  • array1.Intersect(array2)

Reference