Prova così:
Codice PHP:
// ESTRAPOLO I DATI DI MAREA
$lines = file('http://www.fisica.uniud.it:8080/locations/2172.html');
// Loop through our array, show HTML source as HTML source; and line numbers too.
$low=true;
$high=true;
foreach ($lines as $line_num => $line) {
if($low==true && strpos(strtolower($line),"low tide")>0){
$low=false;
echo "Line #[b]{$line_num}[/b] : " . htmlspecialchars($line) . "
\n";
};
echo if($high==true && strpos(strtolower($line),"high tide")>0){
$high=false;
echo "Line #[b]{$line_num}[/b] : " . htmlspecialchars($line) . "
\n";
};
}