XML PHP Display Loop не работает

хорошо, файл XML здесь ►
XML Feed Link

Код, который у меня есть на данный момент:

<?php
// FOOTBALL DATAFEED - WINNER
$matchid = $_GET['matchid'];
//$xmlData = 'http://feeds-sports.winner.com/odds_feed?key=get_events_for_type&lang=en&&sb_type_id=19157';
function viewevent($matchid){
$showdate = date('Y-m-d');
$xmlData = 'http://feeds-sports.winner.com/odds_feed?key=get_all_markets_for_event&lang=en&ev_id='.$matchid;
$xml = simplexml_load_file($xmlData);
$i = 0;
$curdate = date('d/m/Y');
foreach ($xml->Sport->SBClass->SBType->Ev->Mkt as $event)
{
$starttime = $event['start_time'];
$newline = str_replace('-','/',$starttime);
$datecount = strlen($starttime);
$year = substr($newline, 0, 4);
$month = substr($newline, 5, 2);
$day = substr($newline, 8, 2);
$date = $day.'/'.$month.'/'.$year;
$kickoff = substr($newline, 11, 5);
$bettype = $event->Mkt['name'];

if($date == $curdate){
$eventname = '<strong>'.$event['name'].'</strong> @'.$kickoff.'<br/>'.$bettype;
} else {
$eventname = '<strong>'.$event['name'].'</strong> <br /> '.$date.' - @'.$kickoff.'<br />'.$bettype;
}
$watch =  "<a href=\"http://sports.winner.co.uk/en/e/".$event->attributes()->{'ev_id'}."\"><img src=\"watchhd.png\" width=\"121\" height=\"45\" alt=\"Watch in HD\" style=\"vertical-align:center;\" /></a>";

$hometeam = $event->Seln[0]->attributes()->{'name'} .' ('. $event->Seln[0]->attributes()->{'seln_sort'}.') - ';
$homefodds = $event->Seln[0]->Price['frac_prc'];
$homedodds = $event->Seln[0]->Price['dec_prc'];
$homebetref = $event->Seln[0]->Price['bet_ref'];
$homebetlink = 'http://online.winner.com/promoRedirect?key=ej01MjczMzg5OSZsPTAmcD04MDI1NQ%3D%3D&BET_REF='.$homebetref.'&LANGUAGE_CODE=en';
$homebet = "<a href=\"".$homebetlink."\"><img src=\"betnow.gif\" /></a>";$draw = $event->Seln[1]->attributes()->{'name'} .' ('. $event->Seln[1]->attributes()->{'seln_sort'}.') - ';
$drawfodds = $event->Seln[1]->Price['frac_prc'];
$drawdodds = $event->Seln[1]->Price['dec_prc'];
$drawbetref = $event->Seln[1]->Price['bet_ref'];
$drawbetlink = 'http://online.winner.com/promoRedirect?key=ej01MjczMzg5OSZsPTAmcD04MDI1NQ%3D%3D&BET_REF='.$drawbetref.'&LANGUAGE_CODE=en';
$drawbet = "<a href=\"".$drawbetlink."\"><img src=\"betnow.gif\" /></a>";

$awayteam = $event->Seln[2]->attributes()->{'name'} .' ('. $event->Seln[2]->attributes()->{'seln_sort'}.') - ';
$awayfodds = $event->Seln[2]->Price['frac_prc'];
$awaydodds = $event->Seln[2]->Price['dec_prc'];
$awaybetref = $event->Seln[2]->Price['bet_ref'];
$awaybetlink = 'http://online.winner.com/promoRedirect?key=ej01MjczMzg5OSZsPTAmcD04MDI1NQ%3D%3D&BET_REF='.$awaybetref.'&LANGUAGE_CODE=en&PRICE_FORMAT=FRAC';
$awaybet = "<a href=\"".$awaybetlink."\"><img src=\"betnow.gif\" /></a>";// Get MATCH ID
$matchid = $event->EvDetail['br_match_id'];

// Create HTML Row of Event
echo "<div class=\"units-row unit-90 centered\" style=\"border-bottom: 1px solid #333;padding-top:5px; padding-bottom:5px;\">
<div class=\"unit-100\" style=\"margin-left:0px; text-align:center; font-size:90%; margin-bottom: 5px; \">
<div class=\"unit-50\" style=\"margin-left:0px;\">
<div class=\"unit-60\" style=\"margin-left:0px padding-top:5px;\">
<a href=\"football.php?matchid=$matchid\">$event->[mkt_sort_name]</a>
</div>
<div class=\"unit-30\">
$watch
</div>
</div>
<div class=\"unit-50\" style=\"padding-top:5px; font-size:90%;\">
<div class=\"unit-30\">Home Win<br /><strong>$homefodds</strong><br />$homebet</div>
<div class=\"unit-30\">Draw<br /><strong>$drawfodds</strong><br />$awaybet</div>
<div class=\"unit-30\">Away<br /><strong>$awayfodds</strong><br />$awaybet</div>
</div>
</div>
</div>";
}

//print $team->attributes()->{'short_name'} . ' vs ' . PHP_EOL;
//}
}
?>

Теперь я пытаюсь отобразить ВСЕ данные на основе определенного ev_id.

Каждый элемент Mkt содержит атрибут name, и это данные, которые я хочу отобразить в цикле

В настоящее время отображаются первые 2 записи.
и это все

0

Решение

Задача ещё не решена.

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]