title: How do I convert plaintext to a String in php?
body: <p>What I want to do is get the number of pages for the html file, I already got the section that I want but I can't gat the numbers alone.</p>
  
  <pre><code>&lt;?php
  include_once 'simple_html_dom.php';
  error_reporting(E_ERROR);
  
  $html = file_get_html('http://www.seccionamarilla.com.mx/resultados/hospitales/distrito-federal/1');
  foreach($html-&gt;find('.paginas',0) as $e){
  
  //echo $e-&gt;plaintext;
  $res = $e-&gt;plaintext;
  $text = (string)$res;
  echo $res."&lt;br&gt;";
  echo $text."&lt;br&gt;";
  echo substr($text, 10);
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>I am using the yellowpages as an example. This are the results i'm getting.</p>
  
  <pre><code>Resultados (3892) PÃ¡gina 1 -  2 -  3 -  4 -  5   
  Resultados (3892) PÃ¡gina 1 -  2 -  3 -  4 -  5   
  Resultados (3892) PÃ¡gina 1 -  2 -  3 -  4 -  5   
  </code></pre>
  
  <p>I have tried the substr() but it has no effect on it. The only thing I want is the number 3892. Also i would like to get rid of the lines before the output is completed. It goes through the loop and prints nothing for 4 or 5 lines and 3 after the output.</p>