次の XML ファイルを使用しています。
http://xml.nordicbet.com/football.xml
$xml = simplexml_load_file('http://xml.nordicbet.com/football.xml');
foreach ($xml as $gameinfo):
$kodate=$gameinfo->GameStartTime;
$status=$gameinfo->Status;
$id=$gameinfo->EventID;
$league=$gameinfo->LeagueID;
$hometeam=$gameinfo->Participant[0];
$awayteam=$gameinfo->Participant[1];
$region=$gameinfo->Region;
$sport=$gameinfo->Sport;
$season=$gameinfo->Season;
$livebet=$gameinfo->LiveBet;
これらの変数は正しく機能していますが、コードでわかるように、多数の OutcomeSet タグがあります。
<OutcomeSet type="Result" id="50001643467" name="FC Seoul - Ulsan Hyundai Horang-I">
<Outcome odds="1.75" id="50069765963" name="1">
<Participant info="Football" id="10000020100">FC Seoul</Participant></Outcome>
<Outcome odds="3.4" id="50069765964" name="X"/>
<Outcome odds="4.05" id="50069765965" name="2">
上記のコードでは、他の変数と同じように使用できる別の変数として、1.75、3.4、4.05 の 3 つの「オッズ」を抽出したいと考えています。
私が求めているのは、タイプが「結果」である OutcomeSet タグからの情報です
どんな助けでも大歓迎です