返回首页

php对接淘宝商品

86 2024-03-04 10:42 admin
php $appKey, 'method' => $method, 'fields' => 'num_iid,title,pict_url,small_images,reserve_price,zk_final_price,user_type,provcity,item_url', 'q' => '女装', 'cat' => '16,18', 'platform' => '1', 'page_no' => '1', 'page_size' => '20', 'sort' => 'tk_rate_des', ]; $sign = createSign($params, $appSecret); $params['sign'] = $sign; $url = $apiUrl . '?' . http_build_query($params); $response = file_get_contents($url); $data = json_decode($response, true); foreach ($data['results']['n_tbk_item'] as $item) { echo '
'; echo '

商品标题:' . $item['title'] . '

'; echo '

商品价格:' . $item['zk_final_price'] . '

'; echo '

商品销量:' . $item['volume'] . '

'; echo ''; echo '查看详情'; echo '
'; } function createSign($params, $appSecret) { ksort($params); $str = ''; foreach ($params as $key => $value) { $str .= $key . $value; } return strtoupper(md5($appSecret . $str . $appSecret)); } ?>
顶一下
(0)
0%
踩一下
(0)
0%
相关评论
我要评论
用户名: 验证码:点击我更换图片

网站地图 (共30个专题112846篇文章)

返回首页