I want to scrape some google page with file get contents function:
$encoded='http://www.google.co.il/#hl=en&biw=1440&bih=799&sclient=psy-ab&q=site:'.urlencode("http://stackoverflow.com/");
echo file_get_contents($encoded);
When I do this:
echo $encoded;
I get this:
http://www.google.co.il/#hl=en&biw=1440&bih=799&sclient=psy-ab&q=site:http%3A%2F%2Fstackoverflow.com%2F
When I put it in the url.. I get the page that I want
But when I use the function , I simply get the main google page..why does this happen?
See Question&Answers more detail:os