Question

first of all: I really love this site and I think this is the best forum for programming :)

Now to my problem, which I try to display using code and comments:

    $file = fopen ($URL, "r");
    // $URL is a string set before, which is correct
    // Also, I got the page-owners permission to acquire the page like that
    if (!$file) 
    {
        echo "<p>Could not open file.\n";
        exit;
    }
    while (!feof ($file)) 
    {
        $buffer = fgets($file);
        $buffer= strstr($buffer, "Montag</b>"); 
        // If I don't use this line, the whole page gets displayed...
        // If I use this line, only the first line after the needle gets displayed
        echo $buffer;
    }
    fclose($file);

So basically, I'm able to display the whole page, or one line after the needle, but not everything after the needle....

I tried to find a solution using the PHP Reference, the Stackoverflow Search engine and of course google, but I couldn't find a solution, thanks for everybody willing to help me.

Greetings userrr3

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top