title: Extract a string from an object inside an array: PHP
body: <p>I'm writing a PHP plugin and need to extract a string from an object which is inside an array. </p>
  
  <pre><code>var_dump($data)
  </code></pre>
  
  <p>outputs:</p>
  
  <pre><code>array(1) { 
      [0]=&gt; object(stdClass)#380 (53) { 
          ["id"]=&gt; string(1) "2" 
          ["firstname"]=&gt; string(6) "John" 
          ["lastname"]=&gt; string(6) "Doe" 
          ["email"]=&gt; string(31) "johndoe@email.com" 
      } 
  } 
  </code></pre>
  
  <p>I want to return:</p>
  
  <pre><code>johndoe@mail.com
  </code></pre>
  
  <p>My research has turned up functions such as unserialize, array_map, array_slice, and array_column, but I haven't found the right function or combination of functions that work together (nor do I understand them enough) to just return a simple string from an object inside an array. Can anyone provide me with some guidance?</p>
  
  <p>Edit: This isn't the same question as the one referenced as "the exact same question." The other one asks simply how to access an array (answer: $array[0]), and my question asked how to access an object INSIDE an array (answer: $array[0]->text).</p>