0

I am trying to get some data from http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page using the below code.

$some_link = http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page;
$content = file_get_contents($some_link);
echo $content;

But i am getting wrong page instead of the original

Can you please tell me what the problem is?

Thank you.

Vish K
  • 127
  • 1
  • 2
  • 11

1 Answers1

2

You missed quotes when initializing $some_link. This will work.

$some_link = 'http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page';
$content = file_get_contents($some_link);
echo $content;

it will open webpage because $some_link contains HTML code.This opens the same page as http://itunes.apple.com/us/genre/ios-productivity/id6007?mt=8&letter=A&page=10#page

I have already tried and it works fine

Rahul Virpara
  • 1,209
  • 1
  • 12
  • 24