<?php
$array = [
['text' => 'I like Apples', 'id' => '102923'],
['text' => 'I like Apples and Bread', 'id' =>'283923'],
['text' => 'I like Apples, Bread, and Cheese', 'id' => '3384823'],
['text' => 'I like Green Eggs and Ham', 'id' =>'4473873']
];
$search = 'Bread';
var_export(
array_filter($array, fn($subarray) => str_contains($subarray['text'], $search))
);
preferences:
25.96 ms | 406 KiB | 5 Q