1
object(stdClass)#19 (2) { 
    ["status"] =>
        string(7) "success" 
    ["data"] =>
        object(stdClass)#14 (6) {
                ["network"] => 
                    string(3) "BTC" 
                ["txid"] =>
                    string(64) "128830010b4773bb9a88f9c53b67217f37caa092bfd477a81a2f41d6ea804e53"
                ["amount_withdrawn"] =>
                    string(10) "0.00087298"
                ["amount_sent"] =>
                    string(10) "0.00050000"
                ["network_fee"] =>
                    string(10) "0.00037298"
                ["blockio_fee"] =>
                    string(10) "0.00000000"
        }
}

I have this array but I a struggling to find out how to get data from it such as txid, Im not sure whether its json or.. Help would be appreciated

Augwa
  • 2,699
  • 10
  • 22
Brad m
  • 97
  • 1
  • 9

1 Answers1

0

The original variable is a stdClass. The output you posted looks like it's from var_dump.

Formatting your code a little better shows how you can get data from the original variable.

object(stdClass)#19 (2) { 
    ["status"]=> string(7) "success" 
    ["data"]=> object(stdClass)#14 (6) { 
        ["network"]=> string(3) "BTC" 
        ["txid"]=> string(64) "128830010b4773bb9a88f9c53b67217f37caa092bfd477a81a2f41d6ea804e53" 
        ["amount_withdrawn"]=> string(10) "0.00087298" ["amount_sent"]=> string(10) "0.00050000" 
        ["network_fee"]=> string(10) "0.00037298" 
        ["blockio_fee"]=> string(10) "0.00000000" 
    }
}

So, you could get txid from $variable->data->txid but only from the original variable. Unlike var_export, var_dump does not output valid PHP code so you can't get it from that.

Community
  • 1
  • 1
texelate
  • 2,157
  • 3
  • 19
  • 30