Retrieving data from simplexml_load_file
<p>Working with the simplexml_load_file() function, I get a side effect. To understand what I mean, see this code: </p>

<pre><code>$result = simplexml_load_file($xml_link);

$arr = array();
foreach ($result-&gt;element as $elem) {
    $arr[] = $elem-&gt;number[0];
}

print_r($arr);
</code></pre>

<p>Output:</p>

<pre><code>Array
(
[0] =&gt; SimpleXMLElement Object
    (
        [0] =&gt; 330411879136
    )

[1] =&gt; SimpleXMLElement Object
    (
        [0] =&gt; 370346266228
    )

[2] =&gt; SimpleXMLElement Object
    (
        [0] =&gt; 370346266223
    )
)
</code></pre>

<p>How would I store data into the array so that output would look like so:</p>

<pre><code> Array
 (
 [0] =&gt; 330411879136

 [1] =&gt; 370346266228

 [2] =&gt; 370346266223
 )
</code></pre>
