- array_column: documentation ( source)
- array_search: documentation ( source)
<?php
$links = array (
0 =>
array (
'rel' => 'advertisements',
'href' => 'https://api.teamsnap.com/v3/advertisements'
),
1 =>
array (
'rel' => 'active_season_team',
'href' => 'https://api.teamsnap.com/v3/teams'
),
2 =>
array (
'rel' => 'assignments',
'href' => 'https://api.teamsnap.com/v3/assignments'
),
3 =>
array (
'rel' => 'availabilities',
'href' => 'https://api.teamsnap.com/v3/availabilities'
)
);
if(($key = array_search('advertisements', array_column($links, 'rel'))) !== false) {
echo $links[$key]['href'];
}