title: Loop OBJECT and obtain both key and value
body: <p>Ok, here we go. I hope I explain this correctly. </p>
  
  <p>I have an object that i'd like to loop through to obtain both the key and value. Here is an example of the object I'm receiving. Thanks in advance for any help or ideas.</p>
  
  <pre><code>    Array
  (
      [0] =&gt; stdClass Object
          (
              [id] =&gt; 93
              [RecordGUID] =&gt; 
              [txtEmplid] =&gt; 0134754
              [txtFname] =&gt; 
              [txtLname] =&gt; 
              [txtMname] =&gt; 
              [txtEmail] =&gt; 
              [txtSecEmail] =&gt; 
              [txtPhoneNo] =&gt; 4046565454
              [drpMajor] =&gt; 
              [drpStatus] =&gt; 
              [regmain] =&gt; 
              [chkDental] =&gt; 0
              [chkDO] =&gt; 
              [chkMD] =&gt; 
              [chkMDPHD] =&gt; 
              [chkNursin] =&gt; 
              [chkOPT] =&gt; 
              [chkPA] =&gt; 
              [chkPH] =&gt; 
              [chkPharm] =&gt; 
              [chkPOD] =&gt; 
              [chkPostBac] =&gt; 
              [chkVet] =&gt; 
          )
  
  )
  </code></pre>
  
  <p>I basically need to loop through the above info getting both the key and value. For example:</p>
  
  <pre><code>id=93
  RecordGUID=
  txtEmplid=0134754
  </code></pre>
  
  <p>and so on. </p>
  
  <p>Again, thanks in advance for any answers.</p>
  
  <p>UPDATE for DBF
  Here is what I get when I use your code snippt:</p>
  
  <pre><code>int(0)
  object(stdClass)#27 (24) {
    ["id"]=&gt;
    string(2) "93"
    ["RecordGUID"]=&gt;
    NULL
    ["txtEmplid"]=&gt;
    string(7) "0134754"
    ["txtFname"]=&gt;
    string(0) ""
    ["txtLname"]=&gt;
    string(0) ""
    ["txtMname"]=&gt;
    string(0) ""
    ["txtEmail"]=&gt;
    string(0) ""
    ["txtSecEmail"]=&gt;
    string(0) ""
    ["txtPhoneNo"]=&gt;
    string(10) "4045506561"
    ["drpMajor"]=&gt;
    NULL
    ["drpStatus"]=&gt;
    NULL
    ["regmain"]=&gt;
    NULL
    ["chkDental"]=&gt;
    string(1) "0"
    ["chkDO"]=&gt;
    NULL
    ["chkMD"]=&gt;
    NULL
    ["chkMDPHD"]=&gt;
    NULL
    ["chkNursin"]=&gt;
    NULL
    ["chkOPT"]=&gt;
    NULL
    ["chkPA"]=&gt;
    NULL
    ["chkPH"]=&gt;
    NULL
    ["chkPharm"]=&gt;
    NULL
    ["chkPOD"]=&gt;
    NULL
    ["chkPostBac"]=&gt;
    NULL
    ["chkVet"]=&gt;
    NULL
  }
  </code></pre>