file_get_contents() works sometimes - Programmers Heaven

Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

file_get_contents() works sometimes

wh1tepaintwh1tepaint Posts: 2Member
Greetings,

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.

http://en.wikipedia.org/wiki/USS_Enterprise_(CVN-65)

http://en.wikipedia.org/wiki/SMS_Groß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.

Cheers

Comments

  • mattaseymourmattaseymour Posts: 10Member
    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 php.net website to look at some other options and solutions people have come up with.

    Thanks,


    -----------------
    http://www.matthewseymour.co.uk
  • amatzamatz Posts: 1Member
    : 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?

    Amatz,

Sign In or Register to comment.