[ 'header' => "Content-type: application/x-www-form-urlencoded ", 'method' => 'POST', 'content' => http_build_query([ 'deviceNo' => $this->config['deviceNo'], 'key' => $this->config['key'], 'printContent' => $content, 'times' => $this->times ]), ] ]); // API请求:开始打印 $result = file_get_contents(self::API, false, $context); // 处理返回结果 $result = helper::jsonDecode($result); // 记录日志 log_write([ 'describe' => 'PrintCenter(365) PrintTicket', 'result' => $result ]); // 返回状态 if ($result['responseCode'] != 0) { $this->error = $result['msg']; return false; } return true; } }