title: PHP Accessing named array elements issue
body: <p>I have an array which is generated from an XML file and it shows me like below when printed with print_r</p>
  
  <pre><code>Array
  (
      [cxname] =&gt; Global CX 87 123
      [ipaddress] =&gt;  66.240.55.87
      [slots] =&gt; Array
          (
              [slot] =&gt; Array
                  (
                      [0] =&gt; Array
                          (
                              [slotno] =&gt;  1
                              [cardtype] =&gt; 0x24 
                              [modelno] =&gt;  OP3524J
                              [label1] =&gt; OP 
                              [label2] =&gt;  Module
                              [severity] =&gt; Minor
                          )
  
                      [1] =&gt; Array
                          (
                              [slotno] =&gt;  2
                              [cardtype] =&gt; 0x25 
                              [modelno] =&gt;  OP3524K
                              [label1] =&gt; OP 
                              [label2] =&gt;  Module
                              [severity] =&gt; Major
                          )
  
                  )
  
          )
  
  )
  </code></pre>
  
  <p>When I print like this, it shows nothing</p>
  
  <pre><code> echo $dataArray-&gt;cxname;
  </code></pre>
  
  <p>But following code works and prints "Global CX 87 123 "</p>
  
  <pre><code> echo $dataArray["cxname"];
  </code></pre>
  
  <p>How can I make it work as above example.</p>