title: php count xml elements
body: <p>Hi what is the best way to count the number of elements in a XML file? In my case I want to count the number of XML tags with the name "OfferName" within the tag "OfferNameList".</p>
  
  <p>The XML below is contained in a php variable $offers</p>
  
  <pre><code>$offers = '&lt;OfferNameList&gt;
    &lt;OfferName&gt;...&lt;/OfferName&gt;
    &lt;OfferName&gt;...&lt;/OfferName&gt;
    &lt;OfferName&gt;...&lt;/OfferName&gt;
    ...
  &lt;/OfferNameList&gt;';
  </code></pre>
  
  <p>Thanks for the help</p>