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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:48:36+00:00 2026-06-01T05:48:36+00:00

This is so incredibly basic that I am totally baffled as to why it

  • 0

This is so incredibly basic that I am totally baffled as to why it doesn’t work. I have an array called $elements, and I want to just echo out one of the values.

I use NetBeans as an IDE, and if I use that to examine the contents of the multidimensional array in question, it looks like this:

view of array in Netbeans

So far as I can tell, everything looks normal. It is a multidimensional array, where the first level is numbered “0”, and the second level has four named entries.

I just want to echo the value of “parameters”, which is a string.

However, this code outputs nothing:

echo "This is the value of 'parameters': " .  $elements[0]['parameters'];

Have I got this most basic code wrong in some way?


This is what I get if I do var_dump($elements):

array(1) { [0]=> object(Element)#3 (4) { [“type”:”Element”:private]=>
string(4) “Text” [“resource”:”Element”:private]=> string(1) “0”
[“parameters”:”Element”:private]=> string(209) “IP1 111.111.111.111
IP2 222.222.222.222 IP3 333.333.333.333 IP4 444.444.444.444 IP5
555.555.555.555 IP6 666.666.666.666 IP7 777.777.777.777 IP8 888.888.888.888 IP9 999.999.999.999 IP10 111.111.111.112” [“parent”:”Element”:private]=> NULL } }

… and this is the output from print_r($elements):

Array ( [0] => Element Object ( [type:Element:private] => Text [resource:Element:private] => 0 [parameters:Element:private] => IP1 111.111.111.111 IP2 222.222.222.222 IP3 333.333.333.333 IP4 444.444.444.444 IP5 555.555.555.555 IP6 666.666.666.666 IP7 777.777.777.777 IP8 888.888.888.888 IP9 999.999.999.999 IP10 111.111.111.112 [parent:Element:private] => ) ) 
  • 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-01T05:48:37+00:00Added an answer on June 1, 2026 at 5:48 am

    Your var dump is saying that element 0 is an object, so you will need to access it like so:

    echo $elements[0]->parameters;
    

    The problem is that from your dump, the parameters element is marked as private, so you will not be able to access it.

    Solutions are:

    • Change parameters to public
    • Write a getter (getParameters()) and use that method to get your parameters.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Preface: I am sure this is incredibly simple, but I have searched this site
this is my code that I write it but I want to use LINQ
i know this is incredibly easy but I have been writing and rewriting this
I'm new to Haskell, so am sorry if this is incredibly obvious... I have
I'm using MySQLdb and Python. I have some basic queries such as this: c=db.cursor()
This is an incredibly basic question, but how do I start a new CUDA
I have an incredibly basic question, but searching for it in the docs has
This seems incredibly simple but I have no idea why I can't put a
I need to redirect /search?keywords=somesearchterm to /search/somesearchterm This seems incredibly basic but I've been
I must be going insane. This is incredibly simple so I am apparently overlooking

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.