まず第一に、私はこのサイトが大好きで、プログラミングに最適なフォーラムだと思います :)
ここで、コードとコメントを使用して表示しようとする私の問題に進みます。
$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);
基本的に、ページ全体、または針の後の 1 行を表示できますが、針の後のすべてではありません....
PHP リファレンス、Stackoverflow 検索エンジン、そしてもちろん Google を使用して解決策を見つけようとしましたが、解決策を見つけることができませんでした。
こんにちは userrr3