fork(1) download
  1. <?php
  2. $o1 = new StdClass;
  3. $o1->{"abc@gmail.com"} = array();
  4. $o2 = new StdClass;
  5. $o2->{"xyz@gmail.com"} = array();
  6. $inDatabase = [$o1, $o2];
  7.  
  8. print_r($inDatabase);
  9.  
  10. $innerKeys =[];
  11.  
  12. for($i=0;$i<2;$i++){
  13. $temp = array_keys(get_object_vars($inDatabase[$i]));
  14. //so I thought $temp[0] would have the email address but $temp is null.
  15. array_push($innerKeys,$temp[0]);
  16. }
  17. print_r($innerKeys);
  18. ?>
Success #stdin #stdout 0.02s 24208KB
stdin
Standard input is empty
stdout
Array
(
    [0] => stdClass Object
        (
            [abc@gmail.com] => Array
                (
                )

        )

    [1] => stdClass Object
        (
            [xyz@gmail.com] => Array
                (
                )

        )

)
Array
(
    [0] => abc@gmail.com
    [1] => xyz@gmail.com
)