Loop through SimpleXml object in php
<p>I have a simpleXml object and want to read the data from the object.I am new to php.The object details are as follows.I want to read name like general and name which is inside company array i.e Korey Kay &amp; Partners.What is the syntax for it?</p>

<pre><code>SimpleXMLElement Object ( 
    [@attributes] =&gt; Array ( [type] =&gt; array ) 
    [project] =&gt; Array (  
        [0] =&gt; SimpleXMLElement Object ( 
            [created-on] =&gt; 2008-07-18 
            [id] =&gt; 2257372 
            [last-changed-on] =&gt; 2010-05-27T22:28:29Z 
            [name] =&gt; *GENERAL 
            [status] =&gt; active 
            [company] =&gt; SimpleXMLElement Object ( 
                 [id] =&gt; 406952 
                 [name] =&gt; Korey Kay &amp; Partners 
            ) 
        )
    )
)
</code></pre>
