Select from Array to get ID based on Name
<p>Here is my var_dump:</p>

<pre><code>array(2) {
  [1]=&gt;
  object(stdClass)#382 (3) {
    ["name"]=&gt;
    string(12) "Other fields"
    ["sortorder"]=&gt;
    string(1) "1"
    ["id"]=&gt;
    int(1)
  }
  [3]=&gt;
  object(stdClass)#381 (3) {
    ["name"]=&gt;
    string(6) "custom"
    ["sortorder"]=&gt;
    string(1) "2"
    ["id"]=&gt;
    int(3)
  }
}
</code></pre>

<p>I need some PHP to select the 2nd object, obviously it wont always be the 2nd object, so I need to select it based on its ["name"] which will always be "custom".</p>

<p>The below code give's me all the names but I just want "custom" and the get the ID of custom.</p>

<pre><code>foreach ($profilecats as $cat) {
    $settings .= $something-&gt;name;
}
</code></pre>
