Problems accessing array content

Asked

Viewed 50 times

0

I wonder if any of you can help me. I am trying to read the object of the array in question and I am not able to print on the screen, as much as forach. If anyone can help me, I’d be very grateful. Follow the code: P.S.: I would like to print [name] and [email].

Iugu_SearchResult Object
(
    [_totalResults:protected] => 16
    [_results:protected] => Array
        (
            [0] => Iugu_Customer Object
                (
                    [_attributes:protected] => Array
                        (
                            [id] => 123455554545455453
                            [email] => [email protected]
                            [name] => Pré Impressão
                            [notes] => 3
                            [created_at] => 2018-08-09T09:07:24-03:00
                            [updated_at] => 2018-08-09T09:07:24-03:00
                            [cc_emails] => 
                            [cpf_cnpj] => 123454545435
                            [zip_code] => 17213000
                            [number] => 171
                            [complement] => casa
                            [default_payment_method_id] => 
                            [proxy_payments_from_customer_id] => 
                            [city] => Jaú
                            [state] => SP
                            [district] => Chácara Santo Antonio
                            [street] => Rua Antônio Carlos Nunes Takeda
                            [custom_variables] => Array
                                (
                                )

                    )

                [_unsavedAttributes:protected] => Array
                    (
                    )

            )
  • Hello @Leandro, Welcome to Sopt, Some information is missing from your question, for example: What language are you using? (It seems to me to be php) -- You could also put the code you tried it helps the community explain you where the bug is etc.. -- Just take a look at our [Tour] =D

  • Ola Icado. I really forgot to put the language... It’s PHP. Actually this is the result of a function to generate a billet, follows the function: */ Function geraBoleto($customer_id, $ddd, $phone, $items) { $client = Iugu_customer::fetch($customer_id); //echo "<pre>"; //print_r($client); //echo "</pre>"; }

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.