i need some help regarding this study script im building which im trying to fetch articles from a website.
Currently im able to get the article from 1 element but failing to get all elements, this is an example of the url im trying to fetch
<div class="entry-content">
</div>
<div class="entry-content">
</div>
<div class="entry-content">
</div>
This is my PHP code to get the content of the first div :
function getArticle($url){
$content = file_get_contents($url);
$first_step = explode( '<div class="entry-content">' , $content );
$separate_news = explode("</div>" , $first_step[1] );
$article = $separate_news[0];
echo $article;
}