下面来给大家介绍一个php版淘宝网查询商品接口代码的例子,下面要(www.phpfensi.com)改成你的信息的在代码后面都有说明了,同时sdk包我们也要官方下载.
其实我也没做什么只是把标准事例改了下,请下载SDK包解压后与该文件放在同一目录下,代码如下:
- <?php
-
- header("Content-type: text/html; charset=utf-8");
- include "TopSdk.php";
-
-
-
-
- $c = new TopClient;
- $c->appkey = "xx(www.phpfensi.com)xxxx";
- $c->secretKey = "xxxxxxxx";
- $sessionkey= "";
-
- $req = new ItemGetRequest();
- $req->setFields("num_iid,title");
- $req->setNumIid(23899912039);
-
-
-
- $resp = $c->execute($req,"");
- echo "result:";
- print_r($resp);
- ?>
|