$url = ‘http://www.webetutorial.com/codeigniter-tutorial’;

$doc = new DomDocument;
// We need to validate our document before refering to the id
$doc->validateOnParse = true;
$doc->loadHtml(file_get_contents($url));

//print_r($rmbd);

$html = $doc->getElementById(‘city’);
$flag= TRUE;
$content = array();
$i = 0;
$item = array();

foreach($html->getElementsByTagName(‘div’) as $tr) {
print_r($tr->nodeValue);
}

Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.