$array =[];
$array[] = [
'id' => 1,
'name' => 'test2'
];
$array[] = [
'id' => 2,
'name' => 'test2'
];
$array[] = [
'id' => 3,
'name' => 'test2'
];
result = (x for x in xyz if x.id == a)
result = xyz.find(x => x.id == a)
foreach ($array as $item) {
echo $item['id'];
}
Пример #6 Доступ к элементам массива<?php $array = array( "foo" => "bar", 42 => 24, "multi" => array( "dimensional" => array( "array" => "foo" ) ) ); var_dump($array["foo"]); var_dump($array[42]); var_dump($array["multi"]["dimensional"]["array"]); ?>