0
$result = array(1) { [0]=> object(stdClass)#193 (6) { 
["address"]=> string(34) "1PLqeSk7ebVWj4QapBxQ4AyCD2ysfN4CBM" 
["coinbase"]=> bool(false) ["height"]=> int(514260) 
["prevout_hash"]=> string(64) "94dcf79b76f66562d9c3a1f1d581fae3314d97833d1a58ec3ba8cb678098fa0c" 
["prevout_n"]=> int(0) ["value"]=> string(5) "0.001" } }

Hey all,

I am sshing into a server and the above is the returned de_coded Json.

Am am having a hard time pulling information off if it.

echo result[0]object["address"];

Thanks in advance

1
  • 2
    echo $result[0]->address; Commented Mar 21, 2018 at 8:56

1 Answer 1

3

Object can be access using ->. So From your array you can get address by doing following code:

echo $result[0]->address;

http://php.net/manual/en/sdo.sample.getset.php

Sign up to request clarification or add additional context in comments.

1 Comment

@seamus object(stdClass)#193 come from var_dump(), which describe the type of elements, like array(1) or string(64).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.