<?php
$arrays = [
[
"name" => "Morning Ride",
"distance" => "1723.3",
"type" => "Ride",
"id" => "2011096935",
],
[
"name" => "Evening Walk",
"distance" => "3165.5",
"type" => "Walk",
"id" => "2008414015",
],
[
"name" => "Morning walk",
"distance" => "2262.9",
"type" => "Walk",
"id" => "1963423515",
],
[
"name" => "Evening Runining",
"distance" => "531.2",
"type" => "Run",
"id" => "1951087309",
]
];
$res = array_filter($arrays, function($x) {
return $x["type"] == "Walk";
});
print_r($res);
- Output for 7.1.25 - 7.1.33, 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.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- Array
(
[1] => Array
(
[name] => Evening Walk
[distance] => 3165.5
[type] => Walk
[id] => 2008414015
)
[2] => Array
(
[name] => Morning walk
[distance] => 2262.9
[type] => Walk
[id] => 1963423515
)
)
preferences:
144.77 ms | 408 KiB | 5 Q