Hi all, can someone help me get the content of a div in a web site in another domain?
Im a little lost with this.
Jump to Post
Well this is what I would do.
$file = file_get_contents("http://website.com/thepage"); $div = preg_match('#<div id="id">(.*)</div>#',$file); echo $div;
With a regular expression it's quite simple. That should work, if not sorry it's my best guess.
OH I'm sorry, I saw this on the homepage and just realised …
All 4 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.