title: how to get all attribute using php xpath
body: <p>I have one XML file:-</p>
  
  <pre><code>&lt;products&gt;
     &lt;product_id value="1"&gt;
         &lt;tab_id value="251"&gt;
              &lt;dist_region value="5" /&gt;
              &lt;dist_region value="10066" /&gt;
              &lt;dist_region value="10069" /&gt;
         &lt;/tab_id&gt;
     &lt;/product_id&gt;
  &lt;/products&gt;
  </code></pre>
  
  <p>I am use this xpath:-</p>
  
  <pre><code>list($prid) = $product-&gt;xpath("//dist_region[@value]/@value");
      $prid=(string)$prid;
      if(strlen(trim($prid))==0)
      {
          echo ' Is not Match In Product';
          exit;
      }
      echo $prid;
  </code></pre>
  
  <p>and get the output:-</p>
  
  <pre><code>5
  </code></pre>
  
  <p>I want to output like:-
  all dist_region like:-</p>
  
  <pre><code>5,10066,10069
  </code></pre>
  
  <p>how can I get this?</p>