G
G
grenline1231232021-06-12 16:29:32
PHP
grenline123123, 2021-06-12 16:29:32

Can't get value from array?

spoiler
<pre>array(2) {
  ["json"]=>
  array(32) {
    ["code"]=>
    int(3)
    ["user"]=>
    string(26) "ИКС 5 Гипер ООО"
    ["nds10"]=>
    int(5872)
    ["nds18"]=>
    int(176266)
    ["fnsUrl"]=>
    string(12) "www.nalog.ru"
    ["region"]=>
    string(2) "16"
    ["userInn"]=>
    string(12) "7710529680  "
    ["dateTime"]=>
    string(19) "2021-03-09T20:34:00"
    ["kktRegId"]=>
    string(20) "0002615560014628    "
    ["metadata"]=>
    array(5) {
      ["id"]=>
      int(3612324400496390400)
      ["ofdId"]=>
      string(5) "ofd22"
      ["address"]=>
      string(165) "423812,РОССИЯ,Республика Татарстан (Татарстан), , ,Набережные Челны г, ,Сююмбике пр-кт,,д 2/19, , , , "
      ["subtype"]=>
      string(7) "receipt"
      ["receiveDate"]=>
      string(20) "2021-03-09T20:35:12Z"
    }
    ["operator"]=>
    string(83) "Фатхуллина Эльвира Назиповна, Продавец-каccир"
    ["totalSum"]=>
    int(1122177)
    ["creditSum"]=>
    int(0)
    ["numberKkt"]=>
    string(14) "00106900392105"
    ["fiscalSign"]=>
    int(4166349028)
    ["prepaidSum"]=>
    int(0)
    ["operatorInn"]=>
    string(12) "165048534787"
    ["retailPlace"]=>
    string(58) "1181 Омега ГИПЕР Набережные Челны"
    ["shiftNumber"]=>
    int(78)
    ["cashTotalSum"]=>
    int(0)
    ["provisionSum"]=>
    int(0)
    ["ecashTotalSum"]=>
    int(1122177)
    ["operationType"]=>
    int(1)
    ["redefine_mask"]=>
    int(0)
    ["requestNumber"]=>
    int(253)
    ["fiscalDriveNumber"]=>
    string(16) "9289000100202093"
    ["messageFiscalSign"]=>
    float(9.2972289105837E+18)
    ["retailPlaceAddress"]=>
    string(136) "423812, Республика Татарстан (Татарстан), Челны. Набережные, Сююмбике пр-кт, 2/19"
    ["appliedTaxationType"]=>
    int(1)
    ["fiscalDocumentNumber"]=>
    int(43415)
    ["fiscalDocumentFormatVer"]=>
    int(2)
  }


Why can't I get the value like this$json['fiscalDocumentNumber'];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Frolov, 2021-06-13
@Digiport

1. Make sure it's an array and not an object.
2. Maybe there is simply no such value in the array?
What does print_r($json); ?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question