@ 2015-04-16T09:42:54Z <?php
$source = [
array_combine(range(1,10), range(1,10)),
array_combine(range(11,20), range(11,20)),
array_combine(range(21,30), range(21,30))
];
$return = [];
foreach($source as $data) {
$return = array_merge($return, $data);
}
$filter = function ($value, $key) {
return ($value < 25);
};
$return = array_filter($return, $filter, ARRAY_FILTER_USE_BOTH);
var_dump($return);
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 5.6.0 - 5.6.38 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.25 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 array(24) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
[3]=>
int(4)
[4]=>
int(5)
[5]=>
int(6)
[6]=>
int(7)
[7]=>
int(8)
[8]=>
int(9)
[9]=>
int(10)
[10]=>
int(11)
[11]=>
int(12)
[12]=>
int(13)
[13]=>
int(14)
[14]=>
int(15)
[15]=>
int(16)
[16]=>
int(17)
[17]=>
int(18)
[18]=>
int(19)
[19]=>
int(20)
[20]=>
int(21)
[21]=>
int(22)
[22]=>
int(23)
[23]=>
int(24)
}
Output for 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 Notice: Use of undefined constant ARRAY_FILTER_USE_BOTH - assumed 'ARRAY_FILTER_USE_BOTH' in /in/IgFMO on line 19
Warning: array_filter() expects at most 2 parameters, 3 given in /in/IgFMO on line 19
NULL
Output for 4.4.2 - 4.4.9 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 Parse error: syntax error, unexpected '[' in /in/IgFMO on line 3
Process exited with code 255 . Output for 4.3.0 - 4.3.1 , 4.3.5 - 4.3.11 , 4.4.0 - 4.4.1 , 5.0.0 - 5.0.5 Parse error: parse error, unexpected '[' in /in/IgFMO on line 3
Process exited with code 255 . Output for 4.3.2 - 4.3.4 Parse error: parse error in /in/IgFMO on line 3
Process exited with code 255 . preferences:dark mode live preview
325.15 ms | 401 KiB | 423 Q