2
I have as answer this stdClass:
stdClass Object ( [Search_AdvancedResult] => stdClass Object ( [ErrorMessage] => [MaxResults] => 1 [NumObjects] => 1 [QueryID] => 242122 [TotalResults] => 1 [Objects] => stdClass Object ( [RMWSObject2] => stdClass Object ( [ObjectID] => 549012 [EntryDate] => 2016-02-22 16:33:47 [EntryUserName] => de0210598 [ImportDate] => 2016-02-22 16:38:07 [CaptureDate] => 2016-02-22 16:33:00 [CaptureLocation] => DIRECIONAL [ClassCode] => SP1 [ClassName] => ADM Obra - Pagamentos por SP [SourceCode] => DIRECIONAL [SourceName] => Obras [TypeCode] => 311C [TypeName] => 311C (Central de Notas) [StateCode] => [StateName] => [FileType] => PDF [FileSize] => 97066 [BatchId] => 427031 [Indices] => stdClass Object ( [RMWSObjectIndex] => Array ( [0] => stdClass Object ( [IndexDataType] => LB [IndexCode] => OBRA [IndexName] => Obra e Fase [IndexValue] => 311C ) [1] => stdClass Object ( [IndexDataType] => LB [IndexCode] => REG [IndexName] => Regional [IndexValue] => Minas Gerais - MG ) [2] => stdClass Object ( [IndexDataType] => TX [IndexCode] => CPFCNPJ [IndexName] => CPF/CNPJ [IndexValue] => 06981180000116 ) [3] => stdClass Object ( [IndexDataType] => TX [IndexCode] => NNF [IndexName] => Nº (Nota Fiscal ou Processo) [IndexValue] => 5502 ) [4] => stdClass Object ( [IndexDataType] => DT [IndexCode] => DATAEMISS [IndexName] => Data de Emissão [IndexValue] => 22/02/2016 ) [5] => stdClass Object ( [IndexDataType] => NU [IndexCode] => VALOR [IndexName] => *Valor [IndexValue] => 58.51 ) [6] => stdClass Object ( [IndexDataType] => LB [IndexCode] => PR [IndexName] => Possui Rateio? [IndexValue] => NÃO ) [7] => stdClass Object ( [IndexDataType] => LB [IndexCode] => TDP [IndexName] => Tipo do Pagamento [IndexValue] => Boleto Anexado (Paga apenas essa nota) ) [8] => stdClass Object ( [IndexDataType] => TX [IndexCode] => NBDB [IndexName] => Nº do Boleto/Dados Bancários [IndexValue] => ) [9] => stdClass Object ( [IndexDataType] => LB [IndexCode] => PP [IndexName] => Pagamento Parcelado? [IndexValue] => NÃO ) [10] => stdClass Object ( [IndexDataType] => DT [IndexCode] => DATVENC [IndexName] => Vencimento (1ª parcela) [IndexValue] => 29/02/2016 ) [11] => stdClass Object ( [IndexDataType] => TX [IndexCode] => DV [IndexName] => Demais Vencimentos [IndexValue] => ) [12] => stdClass Object ( [IndexDataType] => TX [IndexCode] => CB [IndexName] => Código do Boleto [IndexValue] => ) [13] => stdClass Object ( [IndexDataType] => TX [IndexCode] => DESCRICAO [IndexName] => Descrição [IndexValue] => NOVO LANÇAMENTO CEMIG P.5502 ) [14] => stdClass Object ( [IndexDataType] => LB [IndexCode] => DOCSP1 [IndexName] => DOC - SP [IndexValue] => Contas de Consumo ) ) ) ) ) ) )
I need to get various data as for example the CNPJ that is present in this excerpt:
[IndexCode] => CPFCNPJ [IndexName] => CPF/CNPJ [IndexValue] => 06981180000116
I tried to use foreach()
but there are many classes within each other and I can’t move forward.
It doesn’t make sense to use a repetition loop to access only one attribute. Why not access it directly by following the object string?
– Woss
Already tried to access the object ?
$dados->objeto
– Pedro Henrique