tags:

views:

46

answers:

2

Hi, so I have multiple HTML files which I need to get some praticular data from, I mean theres a bunch of non relative information in this HTML files, but I need just lets say things that are between the <div class="myInfo"> and </div>, after getting this information I want to handle it in my own PHP page, so for example I can insert this data into some variables. Is it even possible using PHP only? (Forgive me for my English mistakes)

A: 

I think you need to use CURL for that

Here is a link http://www.php.net/manual/en/book.curl.php

Starx
+2  A: 

I would use SimpleDom

http://simplehtmldom.sourceforge.net/

// Find all article blocks
foreach(file_get_html('http://smysite.com')-&gt;find('div.myInfo') as $Info) {
    print_r($Info);
}

Alternative. http://php.net/manual/en/book.simplexml.php

RobertPitt
Looks great! I'll try it right away.
SnirD
This is the ultimate tool for DOM Parsing. along side PHP's XMLDOM Functions,, but this is a simple easy starter - i updated post because i posted incorrect link. please review
RobertPitt
That's working just great, this tool is very powerful, thanks.
SnirD