title: PHP foreach not working XML
body: <p>I don't really understand why this foreach is not working:</p>
  
  <pre><code> &lt;?php
      $url = "https://maps.googleapis.com/maps/api/place/textsearch/xml?query=hotels+in+newyork&amp;key=AIzaSyAZAkutsge0U-xZVMvwf_Iw_ubdN2bra64";
      $xml = simplexml_load_file($url);
  
  foreach($xml-&gt;result-&gt;name as $name)
  {
  
      echo $name;
  }
  </code></pre>
  
  <p>it shows only the 1st row!</p>