3
4

More than 5 years have passed since last update.

phpからレスポンスをXMLで取得したい

Last updated at Posted at 2014-06-11

マイ・オークション(出品中)の情報をphpからレスポンスをXMLで取得したいです。

<?php
$ch = curl_init();
$options = array(
  CURLOPT_URL => "https://auctions.yahooapis.jp/AuctionWebService/V2/mySellingList?start=$start"
 ,CURLOPT_HTTPHEADER =>array("Authorization: Bearer $accessToken ")
);
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
$xml = simplexml_load_string($response,'SimpleXMLElement');
print_r($xml);

した結果が下記の通りで、[totalResultsAvailable]の値は本当は0でないです。
/ResultSet/Result の情報が取得できてないのは、[totalResultsAvailable]が0になっているからですか?
cURL 転送用オプションが足りないのでしょうか?
simplexml_load_stringのオプション指定が必用なのでしょうか?

SimpleXMLElement Object ( [@attributes] => Array ( [totalResultsAvailable] => 0 [totalResultsReturned] => 0 [firstResultPosition] => 0 ) [0] => )

3
4
5

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4