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 6941507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:53:41+00:00 2026-05-27T12:53:41+00:00

As a service result I have this array: array(1) { [0]=> object(stdClass)#322 (2) {

  • 0

As a service result I have this array:

array(1) {
  [0]=>
  object(stdClass)#322 (2) {
    ["NOME_PROPRIEDADE"]=>
    string(8) "MATERIAL"
    ["VALORES"]=>
    object(stdClass)#323 (1) {
      ["ValoresPossiveisVO"]=>
      array(5) {
        [0]=>
        object(stdClass)#324 (1) {
          ["VALOR"]=>
          string(15) "CRISTAL INCOLOR"
        }
        [1]=>
        object(stdClass)#325 (1) {
          ["VALOR"]=>
          string(21) "CRISTAL FOTOCROMATICO"
        }
        [2]=>
        object(stdClass)#326 (1) {
          ["VALOR"]=>
          string(6) "RESINA"
        }
        [3]=>
        object(stdClass)#327 (1) {
          ["VALOR"]=>
          string(13) "POLICARBONATO"
        }
        [4]=>
        object(stdClass)#328 (1) {
          ["VALOR"]=>
          string(6) "TRIVEX"
        }
      }
    }
  }

I’m accessing its values like this:

foreach ($res->ObterValoresDosTiposDeProdutoParaWebSiteResult->PropriedadesPossiveisVO as $material)
{
echo $material->NOME_PROPRIEDADE; //it returns me MATERIAL, as expected
}

It works but when I try to access $material->VALORES is returns me that it is a empty array: array(o){}

What am I doing wrong?

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-27T12:53:42+00:00Added an answer on May 27, 2026 at 12:53 pm

    Because the outermost item ($materail) is an array, its internals need to be accessed by [] index. You need $material[0]->VALORES, which is then an object containing objects and arrays. So to get its internal items,

    $material[0]->VALORES->ValoresPossiveisVO[0]->VALOR;
    // "CRISTAL INCOLOR"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have array defined like this : ArrayList<String> items = new ArrayList<String>(); I have
I have a web service that when invoked, returns a Result object that contains
I have some class that I'm passing as a result of a service method,
I have a service which returns an Array of ObjectProxy objects. I would like
I use KSOAP2 library, and web-service returns me string array: <GetChanelResult> <string> string </string>
I have C# WCF service.There I want to convert to JSON String.DataSet contain more
I have a problem with getting jquery to retrieve results from a WCF service.
How does one change / modify the Result property of a web service operation?
Example: I have the following JSON object. {currentVersion : 10.0, folders : [], services
I have a method for reading JSON from a service, I'm using Gson to

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.