jeg har fundet ud af at jeg kan bruge min hjemmeside på universitetet, eneste problem jeg har nu er hvordan jeg kan tilføje linje skift i denne fil:
http://www.plan.aau.dk/~mkje02/andet/super6/wap/opslagstavle.phpKoden er her:
<?php
$URL = "
http://dbu.dk/sr/program.aspx?poolid=6465"; $START = "<!-- PROGRAM START -->";
$END = "<!-- REGION MAIN END -->";
ini_set("allow_url_fopen",true);
$hndl = fopen ($URL, "rb");
$content = "";
do
{
$out = fread ($hndl, 8192);
if (strlen($out) == 0)
{
break;
}
$content .= $out;
}
while(1);
fclose($hndl);
$STARTPOS = strpos($content, $START);
$ENDPOS = strpos($content, $END);
if (($STARTPOS != false) && ($ENDPOS != false))
{
$content = substr($content, $STARTPOS, $ENDPOS-$STARTPOS);
$arr = explode("<tr>", $content);
for ($i=5; $i<count($arr);$i=$i+3)
{
$arr2 = explode("</td>", $arr[$i]);
$dato = strip_tags(trim($arr2[1]));
$hjemmehold = strip_tags(trim($arr2[3]));
$udehold = strip_tags(trim($arr2[5]));
$score = strip_tags(trim($arr2[6]));
echo $dato . " - " . $hjemmehold . " - " . $udehold . " - " . $score . "\n";
}
}
else
{
echo "Unable to find START/END positions";
}
?>