Jump to content

wiki and file_get_contents help


shagey36

Recommended Posts

I want to grab the html from a wiki article so I was planning on using file_get_contents to do that but whenever I do it I get some really weird stuff returned to me. Here is the code:

<?php
$output = file_get_contents('http://en.wikipedia.org/wiki/List_of_PlayStation_3_games');
echo $output;
?>

anybody have any ideas?

Link to comment
https://forums.phpfreaks.com/topic/200301-wiki-and-file_get_contents-help/
Share on other sites

I just ran the code on my web-server...and I got absolutely nothing...until I enabled errors!

 

Warning: file_get_contents(http://en.wikipedia.org/wiki/List_of_PlayStation_3_games): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in E:\FM\temp.php on line 7 

 

Is that what you got, shagey36?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.