首页 商标信息 商标信息示例代码 商标搜索[PHP]

商标搜索示例代码[PHP]

作者: 阅读数:1350 上传时间:2018-08-13

商标搜索

<?php

require_once 'curl.func.php';

$appkey = 'your_appkey_here';
$keyword = '手机';//关键字
$pagesize = 10;
$pagenum = 1;
$url = "https://api.jisuapi.com/trademark/search?keyword=$keyword&pagesize=$pagesize&pagenum=$pagenum&appkey=$appkey";

$result = curlOpen($url, ['ssl'=>true]);
$jsonarr = json_decode($result, true);
//exit(var_dump($jsonarr));

if($jsonarr['status'] != 0)
{
    echo $jsonarr['msg'];
    exit();
}

$result = $jsonarr['result']['list'];

foreach($result as $val)
{
    echo $val['name'].' '.$val['regno'].' '.$val['classid'].' '.$val['appdate'].' '.$val['firsttrialno'].' '.$val['firsttrialdate'].' '.
        $val['announceno'].' '.$val['announcedate'].' '.$val['pic'].' '.$val['agent'].' '.$val['status'].' '.$val['registrant'].'
'; }