Get DIV content from external Website

This is what I always use:

$url="https://somedomain.com/somesite/";
$content = file_get_contents($url);
$first_step = explode( '<div id="thediv">' , $content );
$second_step = explode("</div>" , $first_step[1] );

echo $second_step[0];

Leave a Comment