i am new to html dom parsing with php, there is one page which is having different content in its but having same 'class', when i am trying to fetch content i am able to get content of last div, is it possible that somehow i could get all the content of divs having same class request you to please have a look over my code:
<?php
include(__dir__."/simple_html_dom.php");
$html = file_get_html('http://campaignstudio.in/');
echo $x = $html->find('h2[class="section-heading"]',1)->outertext;
?>
in your example code, you have
as you are calling
find()
with a second parameter of 1, this will only return the 1 element. if instead you find all of them - you can do whatever you need with them...the full code i've just tested is...
which gives the output...