including a specific html element from another site using php echo

bubykung

New Member
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.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 :\[code\]<div id="name"> <p>Sam</p> </div>\[/code\] on the page "http://www.example.com/about.php"what i was trying was \[code\]<?php echo file_get_contents("http://www.example.com #name"); ?>\[/code\] is that the right way to go about it ?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\]sorry for such a basic question
 
Back
Top