Array
(
[0] => Array
(
[node] => Array
(
[id] => 17874292930344481
[text] =>
[created_at] => 1555015118
[did_report_as_spam] =>
[owner] => Array
(
[id] => 6773204196
[is_verified] =>
[profile_pic_url] =>
[username] => gadalka_lida999
)
[viewer_has_liked] =>
[edge_liked_by] => Array
(
[count] => 0
)
)
)
[1] => Array
(
[node] => Array
(
[id] => 18036829474119034
[text] => Her account please
[created_at] => 1555019066
[did_report_as_spam] =>
[owner] => Array
(
[id] => 4245266739
[is_verified] =>
[profile_pic_url] =>
[username] => el94__
)
[viewer_has_liked] =>
[edge_liked_by] => Array
(
[count] => 0
)
)
)
$key = array_search("gadalka_lida999", array_column($array, 'username'));
echo $arr[$key]["username"];
function isItemExists(iterable $source, $expectedKey, $expectedValue): bool
{
$iterator = new RecursiveIteratorIterator(
new RecursiveArrayIterator($source, RecursiveArrayIterator::CHILD_ARRAYS_ONLY),
RecursiveIteratorIterator::LEAVES_ONLY
);
foreach ($iterator as $itemKey => $itemValue) {
if ($expectedKey === $itemKey && $expectedValue === $itemValue) {
return true;
}
}
return false;
}