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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:04:17+00:00 2026-06-18T00:04:17+00:00

The flowing array is stored in var $items (plus more). c74a0dba-5407-4f90-b04e-fdc88c4dd434: { 0: {

  • 0

The flowing array is stored in var $items (plus more).

"c74a0dba-5407-4f90-b04e-fdc88c4dd434": {
"0": {
"value": "Suffolk"
}
},
"91866e91-70d7-405f-900c-475d0c027399": {
"country": {
"0": "GB"
}
},

To view the array i can use:

$county = json_decode($items); 
var_dump($county);

This prints

[c74a0dba-5407-4f90-b04e-fdc88c4dd434"]=> object(stdClass)#24 (1) { ["0"]=> object(stdClass)#25 (1) { ["value"]=> string(15) "Suffolk" } } ["91866e91-70d7-405f-900c-475d0c027399"]=> object(stdClass)#26 (1) { ["country"]=> object(stdClass)#27 (1) { ["0"]=> string(2) "GB" } }

I need to extract the county info ‘Suffolk’ using its unique identifier.

I attempted the below but it produces a server error

$result_county = $county->getElement('c74a0dba-5408-4f90-b04e-fdc88c4dd434')->getElementData()->get('value');

The below is a var_dump of the whole array. The identifier c74a0dba-5408-4f90-b04e-fdc88c4dd434 is the same for each item array.

object(stdClass)#2 (18) { ["4d612549-f4cd-4487-ba42-f091ece35391"]=> object(stdClass)#3 (1) { ["0"]=> object(stdClass)#4 (1) { ["value"]=> string(13) "East Newlem" } } ["5eb77708-72e8-4587-b65e-ee50eb0f9e6d"]=> object(stdClass)#5 (1) { ["0"]=> object(stdClass)#6 (1) { ["value"]=> string(24) "Hillside Estate" } } ["520720dc-c480-405a-ac56-bf317f48d860"]=> object(stdClass)#7 (1) { ["0"]=> object(stdClass)#8 (1) { ["value"]=> string(17) "11 Rees Drive" } } [ECT...

Any ideas?

  • 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-06-18T00:04:18+00:00Added an answer on June 18, 2026 at 12:04 am

    If you treat this as an array in the following manner

    $array = json_decode($items,true);
    echo "<pre>",print_r($array,true),"</pre>"; 
    $key ="c74a0dba-5408-4f90-b04e-fdc88c4dd434";
    echo $array[$key][0]['value'];
    

    It will produce and array structure like below:

    Array
    (
        [4d612549-f4cd-4345-ba42-f091ece35391] => Array
            (
            [0] => Array
                (
                [value] => East Newlem
                )
            )
        [5eb77708-72e8-4676-b65e-ee50eb0f9e6d] => Array
            (
            [0] => Array
                (
                [value] =>Hillside Estate
                )
            )
    )
    

    If you set the json_decoded 2nd argument to true it will return an array rather than the earlier objects.
    I do prefer objects over arrays but all about context and what the data represents (array or object).

    Looks like you have composite objects after the extraction. The process has generated a lot of objects(stdClass) which is typical when a non-object is converted to an object. For instsnce if an example array is converted to an object the object(stdClass) that is generated will have properties that are named by keys and their corresponding values. I think this is what you are seeing here.

    Initially there is a container object holding x objects that mostly consist of 3 keys, the first 2 of which have object values and the third a string value. Accessing the info like a standard object:

    echo $county->{4d612549-f4cd-4487-ba42-f091ece35391}->{0}->value;
    

    ‘East Newlem’ should be returned (if not try placing quotes around the values in the curly braces).

    Broken into objects the data looks like below:

    object(stdClass)#2 (18) {
    ["4d612549-f4cd-4487-ba42-f091ece35391"]=>
        object(stdClass)#3 (1) { ["0"]=>
            object(stdClass)#4 (1) { ["value"]=> string(13) "East Newlem" }
    }
    ["5eb77708-72e8-4587-b65e-ee50eb0f9e6d"]=>
        object(stdClass)#5 (1) { ["0"]=>
            object(stdClass)#6 (1) { ["value"]=> string(24) "Hillside Estate" }
    }
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

have the flowing C++ code: CString info, info2; info.Format(%2d, Value[i]); info2.Format(%4.1f, Value[j]); want to
I have the folowing array: outerarray{ id: 20154, from: { name: xyz, id: 10004
i have the flowing code $LastModified = filemtime($somefile) ; i want to add ten
My Cassandra installation runs on flowing system: Linux with Kernel 2.6.32.22 jna-3.3.0 Java 1.7.0-b147
How do I stop aList from flowing into sumIs? I've tried a couple of
Is it possible to create a border like the flowing image with css? Any
Is it possible to create a Floated Image with text flowing around it in
I have a program which draws some terrain and simulates water flowing over it
I am working on a website and added an animation of clouds flowing using
If I have a flowing layout (position: static / relative), does the browser store

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.