I want to get content (with all css, links working and so on) from specific web page part, which are in <div id="some-content"></div>
preg_match("/<div id=\'some-content\'>(.*)<\/div>/m", file_get_contents('www.xxx.com'), $output);
print_r ($output);
But it returns empty array: Array ( )
What is wrong? Is it problem with preg_match or with web page?
Use DOM Parsers. It has been said innumerate times regex are not powerful enough for parsing HTML.
php’s built in DOM Parser.This is a decent DOM Parser for php. Read this thread (surely) on SO Legendary Catalogue.