I am trying to link my page to another website in which I can use there div tags in order to keep my site up to date.
I've got some code after some research and it's echoing out just 1 string whereas there are multiple div classes on the page and I would like to echo them all. I am just wondering if this is possible or not?
Here is the current code:
<?php
$url = 'http://www.domain.com';
$content = file_get_contents($url);
$activity = explode( '<div class="class">' , $content );
$activity_second = explode("</div>" , $activity );
echo $activity_second[0];
?>
I can echo $activity_second[0]
which will display the first line and $activity_second[1]
which will display the second line.
However, I am looking to expand this over to allow all of the div classes on the same page to be put into an array which can then be echo'd out into different parts of a table.
Thank you for your help in advance.