Problemas para ler XML
Olá pessoal blz?.
Estou com problemas para ler um xml, estou pegando ele com simplexml_load_file(), quando eu dou um vardump ele me mostra todas as propriedades e tals, mas quando eu tento pegar a propriedade(exemplo $xml->emit) ele me retorna null, abaixo está o código.
$arquivo = $_FILES['xml_conta'];
$xml = simplexml_load_file($arquivo['tmp_name']);
var_dump($xml->ide);
Já tentei pegar o arquivo direto do diretório mas da no mesmo. Abaixo o meu var_dump().
object(SimpleXMLElement)#2 (3) { ["@attributes"]=> array(1) { ["versao"]=> string(4) "4.00" } ["NFe"]=> object(SimpleXMLElement)#4 (2) { ["infNFe"]=> object(SimpleXMLElement)#6 (9) { ["@attributes"]=> array(2) { ["versao"]=> string(4) "4.00" ["Id"]=> string(47) "NFe51191203927792000132550010003900572477841258" }
["ide"]=> object(SimpleXMLElement)#8 (22) {
["cUF"]=> string(2) "51"
["cNF"]=> string(8) "47825479"
["natOp"]=> string(33) "Venda Terceiros"
["mod"]=> string(2) "50"
["serie"]=> string(1) "1"
["nNF"]=> string(6) "397894"
["dhEmi"]=> string(25) "2019-12-05T18:35:33-04:00"
["dhSaiEnt"]=> string(25) "2019-12-05T18:35:33-04:00"
["tpNF"]=> string(1) "1"
["idDest"]=> string(1) "1"
["cMunFG"]=> string(7) "51074"
["tpImp"]=> string(1) "3"
["tpEmis"]=> string(1) "2"
["cDV"]=> string(1) "5"
["tpAmb"]=> string(1) "2"
["finNFe"]=> string(1) "2"
["indFinal"]=> string(1) "1"
["indPres"]=> string(1) "1"
["procEmi"]=> string(1) "0"
["verProc"]=> string(7) "3.5.1.2"
["dhCont"]=> string(25) "2019-12-05T15:32:22-04:00"
["xJust"]=> string(23) "sem conexao com o sefaz"
}Discussão (1)
Carregando comentários...