file_get_contents() works sometimes


I am using file_get_contents() to obtain data for an indexing project I am doing. The data I am using is from Wikipedia. With some URLs, there is no issue, with others, the function returns nothing. The first example below works; The second example does not.ßer_Kurfürst_(1913)

When I call the function, I print the data immediately. Any ideas out there with what is going on? Any help is appreciated.



  • Hi,

    I once had a similar problem to what your having using the file_get_contents(). I think the problem I had was that the file I was collecting was so large it just didnt work.

    I ended up just using the file() function. This turned out nicer as all the data was put into an array as opposed to a giant string. Means that you can work with it better.

    It might be worth you checking out the website to look at some other options and solutions people have come up with.


  • : maam/sir,

    i have make a program using Php.
    i have use ADODB for the connection like this

    $conn=new com("Adodb.connection")

    and Ms Access for the Database.
    now my problem is: when i execute my program in Php, my program is running but when i will upload to the internet a Fatal error will appear like this:

    Fatal error: Class 'COM' not found in /home/wwwolpc/public_html/grades/studview1.php on line 13

    can you pls give me a solution to this problem
    can you pls help me to my problem?


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!