select an element in an array depending of another element in the array : <p>I've the following array and I would like to select the <strong>tier</strong> and the <strong>rank</strong> of the array <strong>where queueType is equal to RANKED_FLEX_TT</strong> or RANKED_SOLO_5x5 or RANKED_FLEX_SR. How do I do this? I cannot do the following to select the RANKED_SOLO_5x5 as the array is displayed randomly. That is to say sometimes the queueType RANKED_SOLO_5x5 will be in the array [1] or in the array [2] and not always in the array [0]. So I cannot simply do this to find the tier and the rank where queueType is equal to RANKED_SOLO_5x5:</p>

<pre><code>&lt;?php echo $r1[0]["tier"].' '.$r1[0]["rank"]; ?&gt;
</code></pre>

<p>Here is an example of the array:</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [leagueName] =&gt; Anivia's Hunters
            [tier] =&gt; GOLD
            [queueType] =&gt; RANKED_SOLO_5x5
            [rank] =&gt; IV
            [playerOrTeamId] =&gt; 19302018
            [playerOrTeamName] =&gt; AlLeXaNDeR
            [leaguePoints] =&gt; 55
            [wins] =&gt; 198
            [losses] =&gt; 185
            [veteran] =&gt; 1
            [inactive] =&gt; 
            [freshBlood] =&gt; 
            [hotStreak] =&gt; 
        )

    [1] =&gt; Array
        (
            [leagueName] =&gt; Yorick's Warmongers
            [tier] =&gt; GOLD
            [queueType] =&gt; RANKED_FLEX_TT
            [rank] =&gt; V
            [playerOrTeamId] =&gt; 19302018
            [playerOrTeamName] =&gt; AlLeXaNDeR
            [leaguePoints] =&gt; 0
            [wins] =&gt; 21
            [losses] =&gt; 13
            [veteran] =&gt; 
            [inactive] =&gt; 
            [freshBlood] =&gt; 1
            [hotStreak] =&gt; 
        )

    [2] =&gt; Array
        (
            [leagueName] =&gt; Yorick's Rageborn
            [tier] =&gt; SILVER
            [queueType] =&gt; RANKED_FLEX_SR
            [rank] =&gt; II
            [playerOrTeamId] =&gt; 19302018
            [playerOrTeamName] =&gt; AlLeXaNDeR
            [leaguePoints] =&gt; 100
            [wins] =&gt; 61
            [losses] =&gt; 56
            [veteran] =&gt; 1
            [inactive] =&gt; 
            [freshBlood] =&gt; 
            [hotStreak] =&gt; 
            [miniSeries] =&gt; Array
                (
                    [target] =&gt; 2
                    [wins] =&gt; 1
                    [losses] =&gt; 1
                    [progress] =&gt; LWN
                )

        )

)
</code></pre>
