Array(
array(
'name' => 'title 1',
'price' => '200'
)
array(
'name' => 'title 2',
'price' => '100'
)
array(
'name' => 'title 3',
'price' => '200'
)
)
$result = [];
foreach ($array as $item) {
if (!isset($result[$item['price']]) {
$result[$item['price']] = [];
}
$result[$item['price']][] = $item;
}
var_dump($result);
$NeddleList = [];
foreach ($array as $value) {
if ( is_array($value) ) {
foreach ($value as $val) {
if ($val["price"] == '100') {
array_push($NeedleList, $val);
}
}
}
}
print_r($NeedleList);