0

我对 BlockChain API 响应有疑问。从钱包中获取地址时,地址用双引号括起来,如下所示。如何去掉引号?

“1Dgyv8Qz1nkrJddoyLBepv1RUXSDqCBCdp”

代码:

$resp = file_get_contents($blockchain_receive_root . "v2/receive?key=" . $my_api_key . "&gap_limit=".$gap_limit. "&callback=" . urlencode($callback_url) . "&xpub=" . $my_xpub);
$response = json_decode($resp);

print json_encode($response->address);
4

1 回答 1

1

你不需要删除任何东西。当您调用json_encode添加双引号的字符串时,就会出现问题。

所以只需删除json_encode呼叫,它应该像魅力一样工作:

$resp = file_get_contents($blockchain_receive_root . "v2/receive?key=" . $my_api_key . "&gap_limit=".$gap_limit. "&callback=" . urlencode($callback_url) . "&xpub=" . $my_xpub);
$response = json_decode($resp);

print $response->address;
于 2018-05-12T07:23:25.733 回答