title: Check if value exists within an array of objects
body: <p>I am working on an API which receives a PHP object of <code>$POST</code> data. I am trying to check wether the 'smsPhoneNumber' inside customFields exists but not sure how to do this.</p>
  
  <p>I am currently able to check for 'email' using:</p>
  
  <pre><code>if ( property_exists( $data, 'email' ) ) {
    return true;
  }
  </code></pre>
  
  <p><strong>Question:</strong> How to check if 'smsPhoneNumber' exists?</p>
  
  <p>--</p>
  
  <p><em>var_dump:</em></p>
  
  <pre><code>object(stdClass)[1515]
    public 'email' =&gt; string 'email@email.com'
    public 'customFields' =&gt; 
      array (size=2)
        0 =&gt; 
          object(stdClass)[1512]
            public 'name' =&gt; string 'Firstname'
            public 'value' =&gt; string 'james' 
        1 =&gt; 
          object(stdClass)[1514]
            public 'name' =&gt; string 'smsPhoneNumber'
            public 'value' =&gt; string '077'
  </code></pre>