hittade följande kod som jag tänkte använda och det funkar bra ändå tills jag lägger till TV4+ också i strängen då får jag helt plötsligt TV4 som resultat 2 ggr fattar inte hur jag ska göra för att den ska förstå att det är olika. Tacksam om någon har ett tips
<?php
/**
* - TV.just.nu - Vad som visas på TV just nu
* - Version 0.4 - xxxx-xx-xx -
*
* - Thanks https://www.phpportalen.net and the people there for all help!
* - Henrik Caesar <henrik.caesar@telia.com>
*/
$url = "http://tvprogram.nu/cgi-tvprogram/pp1.cgi?NU-palmpilot.htm";
$fp = fopen("$url", "r") or die("Cannot connect to " . $url);
while (!feof ($fp))
$page .= fgets($fp, 6144);
fclose($fp);
$page = strip_tags($page);
echo strftime("%y%m%d - %H:%M:%S") . "<BR><BR>";
$channels = array('SVT1', 'SVT2', 'TV3', 'TV4', 'KANAL5', 'TV6', 'TV8', 'ZTV');
foreach($channels as $val){
preg_match("/($val.*)\n(.*)/", $page, $chaninfo);
for($a = 1; $a \< count($chaninfo); $a++){
if($a == 1)
echo "\<strong\>" . $chaninfo\[$a\] . "\</strong\>";
else
echo $chaninfo\[$a\] . "\<br\>";
echo "\<br\>";
}
}
?>