title: including a specific html element from another site using php echo
body: <p>im brand new to php (started yesterday) ive got a decent background of html/css and a bit of js so i though id give it a shot.</p>
  
  <p>Im trying to build a simple application to teach myself php and i wanted to reference a piece of html from another site, for example the div :</p>
  
  <p><code>&lt;div id="name"&gt;   &lt;p&gt;Sam&lt;/p&gt;     &lt;/div&gt;</code> on the page "http://www.example.com/about.php"</p>
  
  <p>what i was trying was <code>&lt;?php echo file_get_contents("http://www.example.com #name"); ?&gt;</code> is that the right way to go about it ?</p>
  
  <p>i was also couldnt work out if it was better to use <code>include</code> <code>echo</code> or <code>echo file_get_contents</code></p>
  
  <p>sorry for such a basic question </p>