Ny 数组看起来像这样:
Illuminate\Database\Eloquent\Collection {#2052 ▼
#items: array:3 [▼
0 => App\Models\NewsMeta {#2089 ▶}
1 => App\Models\NewsMeta {#2090 ▶}
2 => App\Models\NewsMeta {#2091 ▶}
]
}
如果我打开数组2:
#original: array:7 [▼
"id" => 17
"post_id" => 240231
"news_tag_id" => 5
"meta_name" => "_thumbnail_id"
"meta_value" => "240232"
"created_at" => "2020-08-06 22:34:06"
"updated_at" => "2020-08-06 22:34:06"
]
现在,鉴于我有 240231,我希望获得值“240232”。
如何在对象的数组内部搜索?
类似于:其中 post_id 是 240231 获取 ts meta_value。
仅供参考:这不是雄辩的或数据库查询。
偶然的你