yaski
web3
- Регистрация
- 21 Фев 2010
- Сообщения
- 658
- Реакции
- 500
- Автор темы
- #1
Приходит вот такая строка json
$tmp = json_decode($_POST["checks"], true);
Красивый вывод
Помогите с циклом foreach. Нужно вытащить в переменные $blockNumber и $topics[1] соответствующие значения.
$tmp = json_decode($_POST["checks"], true);
Код:
string(5927) "[ { "address": "0xf2221792ae03576605a946f8a62b677138c5c1d9", "blockHash": "0x09eae34963e8a197a814e934cb0263c5692366fcbb2ec7074ecaaacfbd8f8c25", "blockNumber": 4105402, "data": "0x", "logIndex": 38, "removed": false, "topics": [ "0xa4aee4c40a9346000546ce1743f64d90b90bd769fa0f9e02381dbbb95cb8533f", "0x0000000000000000000000000000000000000000000000000000000000000001" ], "transactionHash": "0x5a3b92c6a6bca48dd103b88f43b5889af6853fac92f2bfec57a5108451b409fd", "transactionIndex": 35 }, { "address": "0xf2221792ae03576605a946f8a62b677138c5c1d9", "blockHash": "0x45c26545cd0ed04128537e68c38797fdd16e57f1728daec4341f9ac47358ecf3", "blockNumber": 4124532, "data": "0x", "logIndex": 54, "removed": false, "topics": [ "0xa4aee4c40a9346000546ce1743f64d90b90bd769fa0f9e02381dbbb95cb8533f", "0x0000000000000000000000000000000000000000000000000000000000000002" ], "transactionHash": "0x58bc22a296b3c7c8d3f253d6621548571e9be621d3cbf5fd793099f8346ba486", "transactionIndex": 41 }, { "address": "0xf2221792ae03576605a946f8a62b677138c5c1d9", "blockHash": "0x6d7d772776650a6a375bbdbe2ef8f2b84bbed84fbe7ac3ff85c6aec53cf77ddc", "blockNumber": 4124817, "data": "0x", "logIndex": 58, "removed": false, "topics": [ "0xa4aee4c40a9346000546ce1743f64d90b90bd769fa0f9e02381dbbb95cb8533f", "0x0000000000000000000000000000000000000000000000000000000000000002" ], "transactionHash": "0x21b59fd3542c9b30eb6ac280e894a0b7381c970be294e7554e6404560976f42c", "transactionIndex": 53 } ]
Красивый вывод
Код:
[
{
"address": "0xf2221792ae03576605a946f8a62b677138c5c1d9",
"blockHash": "0x09eae34963e8a197a814e934cb0263c5692366fcbb2ec7074ecaaacfbd8f8c25",
"blockNumber": 4105402,
"data": "0x",
"logIndex": 38,
"removed": false,
"topics": [
"0xa4aee4c40a9346000546ce1743f64d90b90bd769fa0f9e02381dbbb95cb8533f",
"0x0000000000000000000000000000000000000000000000000000000000000001"
],
"transactionHash": "0x5a3b92c6a6bca48dd103b88f43b5889af6853fac92f2bfec57a5108451b409fd",
"transactionIndex": 35
},
{
"address": "0xf2221792ae03576605a946f8a62b677138c5c1d9",
"blockHash": "0x45c26545cd0ed04128537e68c38797fdd16e57f1728daec4341f9ac47358ecf3",
"blockNumber": 4124532,
"data": "0x",
"logIndex": 54,
"removed": false,
"topics": [
"0xa4aee4c40a9346000546ce1743f64d90b90bd769fa0f9e02381dbbb95cb8533f",
"0x0000000000000000000000000000000000000000000000000000000000000002"
],
"transactionHash": "0x58bc22a296b3c7c8d3f253d6621548571e9be621d3cbf5fd793099f8346ba486",
"transactionIndex": 41
},
{
"address": "0xf2221792ae03576605a946f8a62b677138c5c1d9",
"blockHash": "0x6d7d772776650a6a375bbdbe2ef8f2b84bbed84fbe7ac3ff85c6aec53cf77ddc",
"blockNumber": 4124817,
"data": "0x",
"logIndex": 58,
"removed": false,
"topics": [
"0xa4aee4c40a9346000546ce1743f64d90b90bd769fa0f9e02381dbbb95cb8533f",
"0x0000000000000000000000000000000000000000000000000000000000000002"
],
"transactionHash": "0x21b59fd3542c9b30eb6ac280e894a0b7381c970be294e7554e6404560976f42c",
"transactionIndex": 53
}
]
Помогите с циклом foreach. Нужно вытащить в переменные $blockNumber и $topics[1] соответствующие значения.