I'm trying to get links from some websites by using Simple Html Dom,(file_get_content)
The problem is that some of these links use a redirect to the actual post, my script follows it all the way to the post but on my website where I link to that post I dont want php to echo out the file "process.php?id=121" but I want it to return the true actual url like "domain.com/redirected-to-here.html"
script looks something like
$html = file_get_html('www.domain.com/post/this-is-a-post.html');
foreach($html->find('div#post a',0) as $linktopost){
echo $linktopost->href;
}
but this returns something like
www.domain.com/redirect.php?id=10
So the question actually is, how can I return the url by using Simple html dom parser AFTER it has been redirected?
Thanks in advance.