Select certain data in PHP Array

     

I get the following output when using this line of code var_dump($ticket->find()); How would I access only the identifiers throughout ALL objects?


I tried var_dump($ticket->find()->identifier); but it returned null.


array (size=2)   0 =>    object(stdClass)[9]   public 'tid' => string '1' (length=1)   public 'uid' => string '22' (length=2)   public 'subject' => string 'iPhone 8' (length=8)   public 'issue' => string 'iPhone 8 screen replacement' (length=27)   public 'device' => string 'iPhone 8' (length=8)   public 'created' => string '2017-05-25 00:01:11' (length=19)   public 'identifier' => string '29cd54bf' (length=8)   public 'status' => string 'New' (length=3)   public 'tech' => string 'None' (length=4)   1 =>    object(stdClass)[11]   public 'tid' => string '2' (length=1)   public 'uid' => string '22' (length=2)   public 'subject' => string 'iPhone 7' (length=8)   public 'issue' => string 'iPhone 7 screen replacement' (length=27)   public 'device' => string 'iPhone 7' (length=8)   public 'created' => string '2017-05-25 00:27:42' (length=19)   public 'identifier' => string 'b47f2c82' (length=8)   public 'status' => string 'New' (length=3)   public 'tech' => string 'None' (length=4)  
  
"
answer1
  
  

You could use array_map to select the properties that you need from each item in the array returned by find:


$filteredFields = array_map(function ($item) {   // Return whatever properties you want here:
return [$item->tid $item->$uid