Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.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_Xml - Fatal编程技术网

Php从数组中获取数据

Php从数组中获取数据,php,xml,Php,Xml,我有一个巨大的阵列,我无法从中获取数据。我只能从第一组项目中获取数据 我需要去 ["USFICO"]=> array(3) { ["FICOScore"]=> string(5) "00650" 摆脱它。但是我只能让顶部部分工作w/$tester=$array['EfxReport']['@attributes']['reportId'];按预期输出到字符串(22)“USConsumerCreditReport”

我有一个巨大的阵列,我无法从中获取数据。我只能从第一组项目中获取数据

我需要去

["USFICO"]=>
          array(3) {
            ["FICOScore"]=>
            string(5) "00650"
摆脱它。但是我只能让顶部部分工作w/$tester=$array['EfxReport']['@attributes']['reportId'];按预期输出到字符串(22)“USConsumerCreditReport”

如何从该数组中获取FICO分数

这是数组

array(1) {
  ["EfxReport"]=>
  array(3) {
    ["@attributes"]=>
    array(2) {
      ["requestNumber"]=>
      string(1) "1"
      ["reportId"]=>
      string(22) "USConsumerCreditReport"
    }
    ["USDecisionPowerExpressReports"]=>
    array(1) {
      ["USDecisionPowerExpressReport"]=>
      array(4) {
        ["@attributes"]=>
        array(2) {
          ["subjectType"]=>
          string(7) "Subject"
          ["multipleNumber"]=>
          string(1) "1"
        }
        ["USMasterHeader"]=>
        array(5) {
          ["CustomerReferenceNumber"]=>
          string(6) "EFX QA"
          ["CustomerNumber"]=>
          string(10) "999KI00553"
          ["ECOAInquiryType"]=>
          string(1) "I"
          ["DateOfRequest"]=>
          string(10) "02/23/2017"
          ["EquifaxReferenceNumber"]=>
          string(9) "187391427"
        }
        ["USConsumerCreditReport"]=>
        array(6) {
          ["@attributes"]=>
          array(2) {
            ["subjectType"]=>
            string(7) "Subject"
            ["multipleNumber"]=>
            string(1) "1"
          }
          ["USHeader"]=>
          array(3) {
            ["Request"]=>
            array(6) {
              ["CustomerReferenceNumber"]=>
              string(6) "EFX QA"
              ["CustomerNumber"]=>
              string(10) "999KI00553"
              ["ConsumerReferralCode"]=>
              string(3) "024"
              ["ECOAInquiryType"]=>
              string(1) "I"
              ["NumberOfMonthsToCountInquiries"]=>
              string(14) "Last 24 Months"
              ["NumberOfMonthsToCountDelinquencies"]=>
              string(23) "Last 6 Years, 11 Months"
            }
            ["CreditFile"]=>
            array(11) {
              ["HitCode"]=>
              array(1) {
                ["@attributes"]=>
                array(2) {
                  ["code"]=>
                  string(1) "1"
                  ["description"]=>
                  string(3) "Hit"
                }
              }
              ["FileSinceDate"]=>
              string(10) "04/16/2003"
              ["DateOfLastActivity"]=>
              string(10) "01/24/2017"
              ["DateOfRequest"]=>
              string(10) "02/23/2017"
              ["Identityscans"]=>
              array(1) {
                ["Identityscan"]=>
                array(1) {
                  ["@attributes"]=>
                  array(2) {
                    ["code"]=>
                    string(1) "8"
                    ["description"]=>
                    string(74) "Unable to perform telephone validation due to insufficient telephone input"
                  }
                }
              }
              ["AddressDiscrepancyIndicator"]=>
              string(1) "N"
              ["CreateCode"]=>
              string(1) "2"
              ["FileStatus1"]=>
              string(3) "016"
              ["FileStatus2"]=>
              string(3) "242"
              ["FileStatus3"]=>
              string(3) "004"
              ["BureauCode"]=>
              string(3) "244"
            }
            ["Subject"]=>
            array(2) {
              ["SubjectName"]=>
              array(3) {
                ["LastName"]=>
                string(7) "DGNNLXZ"
                ["FirstName"]=>
                string(7) "CHANITA"
                ["MiddleName"]=>
                string(1) "S"
              }
              ["SubjectId"]=>
              array(2) {
                ["SubjectSSN"]=>
                string(8) "66639074"
                ["DateOfBirth"]=>
                string(10) "08/17/1988"
              }
            }
          }
          ["USAddresses"]=>
          array(1) {
            ["USAddress"]=>
            array(3) {
              [0]=>
              array(8) {
                ["@attributes"]=>
                array(2) {
                  ["code"]=>
                  string(2) "CA"
                  ["description"]=>
                  string(15) "Current Address"
                }
                ["ParsedStreetAddress"]=>
                array(3) {
                  ["StreetNumber"]=>
                  string(4) "4338"
                  ["StreetName"]=>
                  string(9) "W POTOMAC"
                  ["StreetType"]=>
                  string(3) "AVE"
                }
                ["City"]=>
                string(7) "CHICAGO"
                ["State"]=>
                string(2) "IL"
                ["PostalCode"]=>
                string(5) "60651"
                ["DateAddressFirstReported"]=>
                string(7) "07/2015"
                ["AddressSource"]=>
                array(1) {
                  ["@attributes"]=>
                  array(2) {
                    ["code"]=>
                    string(1) "T"
                    ["description"]=>
                    string(4) "Tape"
                  }
                }
                ["DateAddressLastReported"]=>
                string(7) "02/2017"
              }
              [1]=>
              array(8) {
                ["@attributes"]=>
                array(2) {
                  ["code"]=>
                  string(2) "FA"
                  ["description"]=>
                  string(14) "Former Address"
                }
                ["ParsedStreetAddress"]=>
                array(3) {
                  ["StreetNumber"]=>
                  string(4) "1301"
                  ["StreetName"]=>
                  string(7) "BRUMMEL"
                  ["StreetType"]=>
                  string(8) "ST APT 8"
                }
                ["City"]=>
                string(8) "EVANSTON"
                ["State"]=>
                string(2) "IL"
                ["PostalCode"]=>
                string(5) "60202"
                ["DateAddressFirstReported"]=>
                string(7) "04/2015"
                ["AddressSource"]=>
                array(1) {
                  ["@attributes"]=>
                  array(2) {
                    ["code"]=>
                    string(1) "T"
                    ["description"]=>
                    string(4) "Tape"
                  }
                }
                ["DateAddressLastReported"]=>
                string(7) "04/2015"
              }
              [2]=>
              array(8) {
                ["@attributes"]=>
                array(2) {
                  ["code"]=>
                  string(2) "F2"
                  ["description"]=>
                  string(21) "Second Former Address"
                }
                ["ParsedStreetAddress"]=>
                array(3) {
                  ["StreetNumber"]=>
                  string(4) "1208"
                  ["StreetName"]=>
                  string(11) "W JEFFERSON"
                  ["StreetType"]=>
                  string(8) "ST APT C"
                }
                ["City"]=>
                string(11) "SPRINGFIELD"
                ["State"]=>
                string(2) "IL"
                ["PostalCode"]=>
                string(5) "62702"
                ["DateAddressFirstReported"]=>
                string(7) "06/2014"
                ["AddressSource"]=>
                array(1) {
                  ["@attributes"]=>
                  array(2) {
                    ["code"]=>
                    string(1) "T"
                    ["description"]=>
                    string(4) "Tape"
                  }
                }
                ["DateAddressLastReported"]=>
                string(7) "06/2014"
              }
            }
          }
          ["USEmployments"]=>
          array(1) {
            ["USEmployment"]=>
            array(3) {
              ["@attributes"]=>
              array(2) {
                ["code"]=>
                string(2) "ES"
                ["description"]=>
                string(24) "Last Reported Employment"
              }
              ["Occupation"]=>
              string(14) "CORRECTION OFF"
              ["Employer"]=>
              string(18) "MACON STATE PRISON"
            }
          }
          ["USFICO"]=>
          array(3) {
            ["FICOScore"]=>
            string(5) "00650"
            ["ScoreReasons"]=>
            array(1) {
              ["ScoreReason"]=>
              array(4) {
                [0]=>
                array(1) {
                  ["@attributes"]=>
                  array(3) {
                    ["code"]=>
                    string(5) "00038"
                    ["description"]=>
                    string(69) "Serious delinquency, and derogatory public record or collection filed"
                    ["number"]=>
                    string(1) "1"
                  }
                }
                [1]=>
                array(1) {
                  ["@attributes"]=>
                  array(3) {
                    ["code"]=>
                    string(5) "00010"
                    ["description"]=>
                    string(76) "Prop of balances to credit limits is too high on bank rev or other rev accts"
                    ["number"]=>
                    string(1) "2"
                  }
                }
                [2]=>
                array(1) {
                  ["@attributes"]=>
                  array(3) {
                    ["code"]=>
                    string(5) "00018"
                    ["description"]=>
                    string(35) "Number of accounts with delinquency"
                    ["number"]=>
                    string(1) "3"
                  }
                }
                [3]=>
                array(1) {
                  ["@attributes"]=>
                  array(3) {
                    ["code"]=>
                    string(5) "00014"
                    ["description"]=>
                    string(45) "Length of time accounts have been established"
                    ["number"]=>
                    string(1) "4"
                  }
                }
              }
            }
            ["ScoreIndicator"]=>
            array(1) {
              ["@attributes"]=>
              array(2) {
                ["code"]=>
                string(1) "J"
                ["description"]=>
                string(39) "FICO Score 5 based on Equifax Data (NF)"
              }
            }
          }
          ["USIdentificationSSN"]=>
          array(4) {
            ["MDBSubjectSSN"]=>
            string(9) "666390749"
            ["InquirySubjectSSN"]=>
            string(9) "666390749"
            ["InquirySSNDateIssued"]=>
            string(4) "1992"
            ["InquirySSNStateIssued"]=>
            string(2) "GA"
          }
        }
        ["USDecisionPowerExpressSegment"]=>
        array(4) {
          ["ConsumerDisclosureIndicator"]=>
          array(0) {
          }
          ["ReportTextMessage"]=>
          string(7) "OFFER C"
          ["SSNVarianceIndicator"]=>
          array(0) {
          }
          ["DPExpressProducts"]=>
          array(1) {
            ["DPExpressProduct"]=>
            array(4) {
              [0]=>
              array(5) {
                ["@attributes"]=>
                array(1) {
                  ["number"]=>
                  string(1) "1"
                }
                ["Description"]=>
                string(1) "A"
                ["ApprovalIndicator"]=>
                string(1) "N"
                ["Limit"]=>
                array(0) {
                }
                ["Miscellaneous"]=>
                array(0) {
                }
              }
              [1]=>
              array(5) {
                ["@attributes"]=>
                array(1) {
                  ["number"]=>
                  string(1) "2"
                }
                ["Description"]=>
                string(1) "B"
                ["ApprovalIndicator"]=>
                string(1) "N"
                ["Limit"]=>
                array(0) {
                }
                ["Miscellaneous"]=>
                array(0) {
                }
              }
              [2]=>
              array(5) {
                ["@attributes"]=>
                array(1) {
                  ["number"]=>
                  string(1) "3"
                }
                ["Description"]=>
                string(1) "C"
                ["ApprovalIndicator"]=>
                string(1) "Y"
                ["Limit"]=>
                array(0) {
                }
                ["Miscellaneous"]=>
                array(0) {
                }
              }
              [3]=>
              array(5) {
                ["@attributes"]=>
                array(1) {
                  ["number"]=>
                  string(1) "4"
                }
                ["Description"]=>
                string(1) "D"
                ["ApprovalIndicator"]=>
                string(1) "N"
                ["Limit"]=>
                array(0) {
                }
                ["Miscellaneous"]=>
                array(0) {
                }
              }
            }
          }
        }
      }
    }
    ["USPrintImage"]=>
    array(0) {
    }
  }
}

你犯了什么错误?尝试:

$tester=$array['EfxReport']['USDecisionPowerExpressReports']['USDecisionPowerExpressReport']['USConsumerCreditReport']['USFICO']['FICOScore']


另外,我真的希望这是假的数据,您在阵列打印输出中包含了非常个人/敏感的信息。

您遇到了什么错误?尝试:

$tester=$array['EfxReport']['USDecisionPowerExpressReports']['USDecisionPowerExpressReport']['USConsumerCreditReport']['USFICO']['FICOScore']


另外,我真的希望这是假的数据,您在数组打印输出中包含了非常个人/敏感的信息。

不要将XML转换为数组。直接使用API。您丢失了数据和功能(Xpath)。不要将XML转换为数组。直接使用API。您将丢失数据和功能(Xpath)。