English 中文(简体)
2. 如何使用xml api
原标题:How to use a xml api
  • 时间:2011-03-30 22:02:48
  •  标签:
  • php
  • xml
  • api

我在玩笑了,但我刚从Xml开始,我如何装上这个ur子,然后打上游戏门?

The url is like this:

http://xboxapi.xxxxxxx.co.uk/profile?apikey=$key&gamertag=$gamertag

返回

<xbox status="success" version="0.0.9">
  <gamertag>l RaH l</gamertag>
  <motto>I Win With Randoms</motto>
  <avatar>
      <full>http://avatar.xboxlive.com/avatar/l rah l/avatar-body.png</full>
      <small>http://avatar.xboxlive.com/avatar/l rah l/avatarpic-s.png</small>
      <large>http://avatar.xboxlive.com/avatar/l rah l/avatarpic-l.png</large>
  </avatar>
  <gamerscore>12550</gamerscore>
  <biography><![CDATA[Bio]]></biography>
  <recentactivity>
      <game>
          <title>Xbox.com</title>
          <artwork>/Content/Images/Presence/xboxcom.jpg</artwork>
          <presence>Last played less than a minute ago</presence>
      </game>
      <game id="1297287259">
          <title>Halo: Reach</title>
          <artwork>http://tiles.xbox.com/consoleAssets/4D53085B/en-US/largeboxart.jpg</artwork>
          <gamerscore>
              <current>1205</current>
              <outof>1400</outof>
          </gamerscore>
      </game>
      <game id="1297287142">
          <title>Halo 3</title>
          <artwork>http://tiles.xbox.com/consoleAssets/4D5307E6/en-US/largeboxart.jpg</artwork>
          <gamerscore>
              <current>1750</current>
              <outof>1750</outof>
          </gamerscore>
      </game>
  </recentactivity>
  <freshness>new</freshness>
</xbox>
最佳回答

你们需要阅读在XML处理功能中建筑的购买力平价。

SimpleXML would be the easiest option http://php.net/manual/en/book.simplexml.php

或可人工通过OMS文件

还确保您的xml在最高一级拥有有效的Xml声明

<?xml version="1.0" encoding="utf-8"?>
问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签