1

Using PHP, I want to echo only address value , how i will get.

Using an API

print_r(coinpayments_api_call('get_deposit_address'));

I get:

Array ( [error] => ok [result] => Array ( [address] => 34JHMyDLriZizkV7nZZo63FbHzJetWhTqd ) )

How i print only address value ,that is=34JHMyDLriZizkV7nZZo63FbHzJetWhTqd ?

2

1 Answer 1

6

You can access the value of an associative array by using the key between square brackets. If you want a value on a lower level, you can keep adding square brackets.

$array = coinpayments_api_call('get_deposit_address');
echo $array['result']['address'];
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.