title: how to replace string/ word in parsing html with php?
body: <p>i have table like  </p>
  
  <pre><code>&lt;html&gt;
    &lt;body&gt;
      &lt;table id="data" class="outer"&gt;
          &lt;tr&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;12-09-12&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Price&lt;/td&gt;&lt;td&gt;15.00&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Count&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;/tr&gt;          
      &lt;/table&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>i have to parse this to give out put for more than 100 
  but i am unable to get how value for  "Date" "12-09-12" can be replaced with new value from database value.</p>
  
  <p>please give me a small example </p>
  
  <pre><code>$html = new simple_html_dom();
  $html-&gt;load_file($page);
  
  $items = $html-&gt;find('Date');  
  </code></pre>
  
  <p>`
  
  <pre><code>$s = '&lt;html&gt;
    &lt;body&gt;
      &lt;table id="data" class="outer"&gt;
          &lt;tr&gt;&lt;td&gt;Date&lt;/td&gt;&lt;td&gt;12-09-12&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Price&lt;/td&gt;&lt;td&gt;15.00&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;Count&lt;/td&gt;&lt;td&gt;67&lt;/td&gt;&lt;/tr&gt;          
   &lt;/table&gt;
    &lt;/body&gt;
  &lt;/html&gt;';
  $document = new DOMDocument();
  $document-&gt;loadHTML($s);
  
  $oElement = $document-&gt;getElementById('data');
  $tds = $oElement-&gt;getElementsByTagName('td');
  if( 'td' == strtolower($tds-&gt;item(0)-&gt;tagName) AND 'date' == strtolower($tds-&gt;item(0)-&gt;nodeValue) )
  
  {
      echo 'Old value: ' . $tds-&gt;item(1)-&gt;nodeValue;
      echo '&lt;hr/&gt;';
  
      $tds-&gt;item(1)-&gt;nodeValue = '13-08-11';
      echo $document-&gt;saveHTML(); //output modified HTML
  }
  ?&gt;
  </code></pre>
  
  <p>`can anyone help me ?</p>