enable soap!
This produces a table of goal scorers…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
<?php if ($_POST['topn'] > 0 && (int) $_POST['topn'] <= 20){ $topn = (int) $_POST['topn']; $client = new SoapClient("http://footballpool.dataaccess.eu/data/info.wso?wsdl"); $result = $client->TopGoalScorers(array('iTopN' => $topn)); // Note that $array contains the result of the traversed object structure $array = $result->TopGoalScorersResult->tTopGoalScorer; print " <table border='2'> <tr> <th>Rank</th> <th>Name</th> <th>Goals</th> </tr> "; foreach($array as $k=>$v){ print " <tr> <td align='right'>" . ($k+1) . "</td> <td>" . $v->sName . "</td> <td align='right'>" . $v->iGoals . "</td> </tr>"; } print "</table>"; } else { ?> <form id="topscorers" action="soapfootball.php" method="post"> How long should your topscorers list be? (Choose a digit between 1 and 20). <input id="topn" name="topn" size="2" type="text" value="10" /> <input id="submit" name="submit" type="submit" value="submit" /> </form> <?php } |