title: Convert HTML output into a plain text using php
body: <p>I'm trying to convert my sample HTML output into a plain text but I don't know how. I  use file_get_contents but the page which I'm trying to convert returns most like the same. </p>
  
  <pre><code>$raw = "http://localhost/guestbook/profiles.php";
  $file_converted = file_get_contents($raw);
  echo $file_converted;
  </code></pre>
  
  <p>profiles.php</p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Profiles - GuestBook&lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="css/style.css"&gt;
      &lt;/head&gt;
  &lt;body&gt;
      &lt;!-- Some Divs --&gt;
      &lt;div id="profile-wrapper"&gt;
          &lt;h2&gt;Profile&lt;/h2&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Name:&lt;/td&gt;&lt;td&gt; John Dela Cruz&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Age:&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Location:&lt;/td&gt;&lt;td&gt; SomewhereIn, Asia&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Basically, I trying to echo out something like this (plain text, no styles)</p>
  
  <pre><code>Profile
  Name: John Dela Cruz
  Age: 15
  Location: SomewhereIn, Asia
  </code></pre>
  
  <p>but i don't know how. :-( . Please help me guys , thank you in advance.</p>
  
  <p>EDIT: Since i am only after of the content of the page, no matter if it's styled or just a plain text , is there a way to select only (see code below) using file_get_contents() ? </p>
  
  <pre><code> &lt;h2&gt;Profile&lt;/h2&gt;
          &lt;table&gt;
              &lt;tr&gt;
                  &lt;td&gt;Name:&lt;/td&gt;&lt;td&gt; John Dela Cruz&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Age:&lt;/td&gt;&lt;td&gt;15&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;Location:&lt;/td&gt;&lt;td&gt; SomewhereIn, Asia&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>