Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932269
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:48:39+00:00 2026-05-22T14:48:39+00:00

Sorry for the title, I couldn’t find a better way to write it =/

  • 0

Sorry for the title, I couldn’t find a better way to write it =/

I am receiving a error object called ErrorBase.

If there is only one error it will return me the following:

public 'ErrorBase' => 
      public 'CODIGO_ERRO' => string '1' (length=1)
      public 'MENSAGEM_ERRO' => string 'Autenticação Inválida' (length=24)
      public 'TIPO_ERRO' => string 'Usuario' (length=7)

But if there is more than one error, it will return me a array of objects like this:

public 'ErrorBase' => 
array
  0 => 
    object(stdClass)[30]
      public 'CODIGO_ERRO' => string '1' (length=1)
      public 'MENSAGEM_ERRO' => string 'Autenticação Inválida' (length=24)
      public 'TIPO_ERRO' => string 'Usuario' (length=7)
  1 => 
    object(stdClass)[31]
      public 'CODIGO_ERRO' => string '002' (length=3)
      public 'MENSAGEM_ERRO' => string 'teste 002' (length=9)
      public 'TIPO_ERRO' => string 'tipo 002' (length=8)
  2 => 
    object(stdClass)[32]
      public 'CODIGO_ERRO' => string '003' (length=3)
      public 'MENSAGEM_ERRO' => string 'teste 003' (length=9)
      public 'TIPO_ERRO' => string 'tipo 003' (length=8)
  3 => 
    object(stdClass)[33]
      public 'CODIGO_ERRO' => string '004' (length=3)
      public 'MENSAGEM_ERRO' => string 'teste 004' (length=9)
      public 'TIPO_ERRO' => string 'tipo 004' (length=8)

How can I work with these situations?
How do I check if there is a array of objects or only a object?

Thanks in advance for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:48:40+00:00Added an answer on May 22, 2026 at 2:48 pm

    Use is_array() :

    if (is_array($this->ERROR_BASE))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry about the title, I couldn't think of a better way to describe the
Sorry for the bad title (couldn't think of a better way to describe it)
I'm sorry, the title's awful; however, I couldn't think of any better way to
Sorry I couldn't think of a better way to title this. In Amazon's SimpleDB,
Sorry about the question title, but I couldn't find a more appropriate way to
I know the title is vague, sorry I couldn't think of a better way
Sorry for the title, I couldn't argue something better. Here is my question: Is
Sorry for the bad title, but I couldn't think of a better one. I'm
Sorry about the title, I couldn't find the right word. I'll try my best
Sorry for the rather vague title, I couldn't think up a better description for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.