我有2個日期數組。我需要最有效的方法來構建第三個日期數組,其中只包含日期的兩個數組中相同的日期。如何從PHP中的日期現有數組中創建新的日期數組?
例如:
List of Dates #1:
2017-01-01
2017-01-02
2017-01-03
2017-02-01
2017-02-02
2017-09-09
List of Dates #2:
2017-01-01
2017-02-01
2017-03-01
2017-04-01
So array 3 should be:
2017-01-01
2017-02-01
可能會有幫助:https://www.w3schools.com/php/func_array_uintersect.asp –