Below is a part of my produced array. How can I keep only every second element usign PHP?
I have tried this until now without luck, maybe it depends on the structure of the array, I didn't understand.
$size = count($array);
$result = array();
for ($i = 0; $i < $size; $i += 2) {
$result[] = $array[$i];
}
var_dump($result);
this is my array below:
Array
(
[0] => Array
(
[0] =>
11.490
[1] =>
11.490
[2] =>
13.490
[3] =>
13.490
[4] =>
17.490
[5] =>
17.490
[6] =>
20.990
[7] =>
20.990
[8] =>
14.290
[9] =>
14.290
[10] =>
14.490
[11] =>
14.490
[12] =>
19.990
[13] =>
19.990