title: How to get the text of an HTML tag with simple_html_dom.php
body: <p>I'm trying to get the text that contains certain tags within the <code>HTML</code> on a page, I'm using <code>simple_html_dom.php</code> that I thought was good for this. Without more I leave an example of my problem.</p>
  
  <p>This is the function in php</p>
  
  <pre><code>require('simple_html_dom.php');
  
  function precioExito($url){
      $html = new simple_html_dom();
      $html-&gt;load_file($url);
      $posts = $html-&gt;find('p[class=price offer]');
      foreach($posts as $post) {
          $resultado = str_replace ( ".0", '', $post);
          break;
      }
      return $resultado;
  }
  </code></pre>
  
  <p>What I do is that I call this function if I do an echo to that value it shows me the value on the screen (View image)</p>
  
  <p><a href="https://i.stack.imgur.com/zquc6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zquc6.png" alt="Click to see image"></a></p>
  
  <p>But when that value that returns to me I send it to the BD, this is what saves me in the BD. (View image)</p>
  
  <p><a href="https://i.stack.imgur.com/JBOo1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JBOo1.png" alt="Click to see image"></a></p>
  
  <p>As you can see, it's bringing me the whole HTML tag and not just the value.</p>
  
  <p><strong>QUESTION</strong></p>
  
  <p>How can I get only the value of this tag in order to save it?</p>