I have an array that is structured as such:
$data = array(
"abc"=>array(
"label" => "abc",
"value" => "def",
"type" => "ghi",
"desc" => "jkl",
),
"def"=>array(
"label" => "mno",
"value" => "qrs",
"type" => "tuv",
"desc" => "wxyz",
),
);
I want to use preg_match with a foreach loop to perform a search on the arrays contained in $data and return the nested arrays of key value pairs.
Something like this?
Case-insensitive unicode grep on column
columnName
in array$haystack
preg_match_all returns the rows that match a pattern with a specific column name.
If you are using PHP 5.5 and are viewing this question in 2015, this might be a more simple answer:
for the googlers out there here's the better code