$listarray = array(0 => array('OpenLeague 5154 Public Server', 'http://openleague.org/~Mr_Molez/ROTATIONreportfile'), 1 => array('OpenLeague Match Servers', '../logs/ROTATIONreportfile'), 2 => array('OpenLeague Replay Servers', '../logs/ROTATIONreplayreportfile') $parseme = count($listarray); for ($i=0; $i<$parseme; $i++) { echo '
'.$listarray[$i][0].' Report file ' .'

' ; $first = true; $location = $listarray[$i][1]; $txt = file ($location); foreach ($txt as $line){ $line = trim($line); if ($line{0} == '[' && $line{strlen($line)-1}==']'){ if (!$first) echo '


'; $first = false; echo ''. substr ($line, 1, strlen($line)-2) .':'; }