title: get value using DOMDocument
body: <p>I am trying to fetch a value from the following html snippet using DOMDocument:</p>
  
  <pre><code>&lt;h3&gt;
      &lt;meta itemprop="priceCurrency" content="EUR"&gt;€ 
  
      &lt;meta itemprop="price" content="465.0000"&gt;465
  &lt;/h3&gt;
  </code></pre>
  
  <p>I need to fetch the value 465 from this code snippet. To avail this I am using the following code:</p>
  
  <pre><code>foreach($dom-&gt;getElementsByTagName('h3') as $h) {
    foreach($h-&gt;getElementsByTagName('meta') as $p) {
  
      if($h-&gt;getAttribute('itemprop') == 'price') {
          foreach($h-&gt;childNodes as $child) {
              $name = $child-&gt;nodeValue;
                          echo $name;
                          $name = preg_replace('/[^0-9\,]/', '', $name);
                        //  $name = number_format($name, 2, ',', ' ');
                          if (strpos($name,',') == false) 
                          {
                           $name = $name .",00";
                          }
           }
         }
       }
     }
  </code></pre>
  
  <p>But this code is not fetching the value...can anyone please help me on this.</p>