title: how to get innerhtml by classname or id using php
body: <p>Hi i am loading content from external url. something like this.</p>
  
  <pre><code>$html=get_data($external_url);
  </code></pre>
  
  <p>where get_data() is a function for getting content using curl.</p>
  
  <p>now after this , i want to get the inner html from different html elements like h1,div,p,span by using their class  or id.</p>
  
  <p>for example
  if the content from external url($html) is something like this.</p>
  
  <pre><code>&lt;html&gt;
  &lt;title&gt;&lt;/title&gt;
  &lt;body&gt;
      &lt;h1 class="title"&gt;I am title&lt;/h1&gt;
      &lt;div id="content"&gt;
          i am the content.
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>now i want to get the inner html of a html tag with class="title". similarly i want to get inner html of a tag with id="content"</p>
  
  <p>How to do this using php? i have no knowledge about DOM, XML. please help. </p>