Bekager, det har jeg også prøvet, som du kan se her, merger den, men unique virker ikke..
$test = array_unique(array_merge($dates, $visits), SORT_REGULAR);
Alt det der har [1] => 1 er det der skulle erstarte den anden array, altså det er array2
Array
(
[0] => Array
(
[0] => 2015-10-02
[1] => 0
)
[1] => Array
(
[0] => 2015-10-03
[1] => 0
)
[2] => Array
(
[0] => 2015-10-04
[1] => 0
)
[3] => Array
(
[0] => 2015-10-05
[1] => 0
)
[4] => Array
(
[0] => 2015-10-06
[1] => 0
)
[5] => Array
(
[0] => 2015-10-07
[1] => 0
)
[6] => Array
(
[0] => 2015-10-08
[1] => 0
)
[7] => Array
(
[0] => 2015-10-09
[1] => 0
)
[8] => Array
(
[0] => 2015-10-10
[1] => 0
)
[9] => Array
(
[0] => 2015-10-11
[1] => 0
)
[10] => Array
(
[0] => 2015-10-12
[1] => 0
)
[11] => Array
(
[0] => 2015-10-13
[1] => 0
)
[12] => Array
(
[0] => 2015-10-14
[1] => 0
)
[13] => Array
(
[0] => 2015-10-15
[1] => 0
)
[14] => Array
(
[0] => 2015-10-16
[1] => 0
)
[15] => Array
(
[0] => 2015-10-17
[1] => 0
)
[16] => Array
(
[0] => 2015-10-18
[1] => 0
)
[17] => Array
(
[0] => 2015-10-19
[1] => 0
)
[18] => Array
(
[0] => 2015-10-20
[1] => 0
)
[19] => Array
(
[0] => 2015-10-21
[1] => 0
)
[20] => Array
(
[0] => 2015-10-22
[1] => 0
)
[21] => Array
(
[0] => 2015-10-23
[1] => 0
)
[22] => Array
(
[0] => 2015-10-24
[1] => 0
)
[23] => Array
(
[0] => 2015-10-25
[1] => 0
)
[24] => Array
(
[0] => 2015-10-26
[1] => 0
)
[25] => Array
(
[0] => 2015-10-27
[1] => 0
)
[26] => Array
(
[0] => 2015-10-28
[1] => 0
)
[27] => Array
(
[0] => 2015-10-29
[1] => 0
)
[28] => Array
(
[0] => 2015-10-30
[1] => 0
)
[29] => Array
(
[0] => 2015-10-31
[1] => 0
)
[30] => Array
(
[0] => 2015-11-01
[1] => 0
)
[31] => Array
(
[0] => 2015-11-02
[1] => 0
)
[32] => Array
(
[0] => 2015-10-04
[1] => 1
)
[33] => Array
(
[0] => 2015-10-05
[1] => 1
)
[34] => Array
(
[0] => 2015-10-06
[1] => 1
)
[35] => Array
(
[0] => 2015-10-12
[1] => 1
)
[36] => Array
(
[0] => 2015-10-13
[1] => 1
)
[37] => Array
(
[0] => 2015-10-14
[1] => 1
)
[38] => Array
(
[0] => 2015-10-15
[1] => 1
)
[39] => Array
(
[0] => 2015-10-16
[1] => 1
)
[40] => Array
(
[0] => 2015-10-17
[1] => 1
)
[41] => Array
(
[0] => 2015-10-19
[1] => 1
)
)
EDITFixed det ved at gøre dette:
- $unique_array = array();
- foreach ($unique as $val) {
- $unique_array[$val[0]] = $val;
- }
Indlæg senest redigeret d. 02.11.2015 14:07 af Bruger #17509