Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从数组中获取单个结果_Php_Arrays_Json_Object - Fatal编程技术网

Php 从数组中获取单个结果

Php 从数组中获取单个结果,php,arrays,json,object,Php,Arrays,Json,Object,我有这个数组,但我很难找到如何从它获取数据,比如txid,我不确定它是json还是。。非常感谢您的帮助原始变量是一个。您发布的输出看起来像来自 将代码格式化得稍微好一点,可以显示如何从原始变量获取数据 因此,您可以从$variable->data->txid获取txid,但只能从原始变量获取。与之不同,var\u dump不会输出有效的PHP代码,因此您无法从中获取它。原始变量是一个。您发布的输出看起来像来自 将代码格式化得稍微好一点,可以显示如何从原始变量获取数据 因此,您可以从$variab

我有这个数组,但我很难找到如何从它获取数据,比如txid,我不确定它是json还是。。非常感谢您的帮助

原始变量是一个。您发布的输出看起来像来自

将代码格式化得稍微好一点,可以显示如何从原始变量获取数据


因此,您可以从
$variable->data->txid
获取
txid
,但只能从原始变量获取。与之不同,
var\u dump
不会输出有效的PHP代码,因此您无法从中获取它。

原始变量是一个。您发布的输出看起来像来自

将代码格式化得稍微好一点,可以显示如何从原始变量获取数据


因此,您可以从
$variable->data->txid
获取
txid
,但只能从原始变量获取。与之不同,
var\u dump
不输出有效的PHP代码,因此您无法从中获取它。

它是一个对象,而不是数组。所以使用$object->data->txidIt是一个对象,而不是数组。所以使用$object->data->txid
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"
        }
}
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" 
    }
}