php
$data = [
['name' => 'Foo Bar', 'id' => 1],
['name' => 'Bar Baz', 'id' => 2],
];
Assuming the above array parameter searching for 1 would return:
php
$data = [
['name' => 'Foo Bar', 'id' => 1],
];
Searching for the string Bar would return the the orignal array is bar would be found in both.
public static search ( array $array, string $searchText, boolean $sensitive = false ) : array | ||
$array | array | The multidimensional array keys. |
$searchText | string | The text you where search inside the rows. |
$sensitive | boolean | Whether to use strict sensitive search (true) or case insenstivie search (false). |
return | array | The modified array depending on the search result hits. |