Skip to content Skip to sidebar Skip to footer

Fetching Data From A Specific Div Id Using Php

Possible Duplicate: read XML tag id from php what is the way to fetch data from A Specific div id Using PHP. What i want to do is to fetch data from a div id called
, 0)->plaintext;

Their are some ways to exclude content from div id or Tag id like,

1) Using regex

2) Using SimpleXML

3) With DOM extension Or XPath

Solution 2:

With Simple HTML DOM Parser

<?php$content = file_get_contents_curl("http://www.example.com");

$html = file_get_html($content );
$ret = $html->find('div[id=divname]');
?>

Post a Comment for "Fetching Data From A Specific Div Id Using Php"