Jump to content

Name of Array Format


doubledee

Recommended Posts

What is the name for this Array Format...

 

$resultsArray[] = array('questionID' => $questionID,
				'question' => $question,
				'answer' => $new_answer,
				'DB_answer' => $old_answer,
				'message' => $message[$q]);

 

 

And does this have anything to do with Object-Oriented Programming?!

 

Thanks,

 

 

Debbie

 

Link to comment
Share on other sites

It is a multidimensional array if that is what you are asking. That means that the array has more than one dimension.

Here's a one dimensional array:

 $array = array( 'key' => 'value' );

Here's a multidimensional array:

 $array = array( array( 'key' => 'value' ) );

 

Your array has more than one dimension because:

$resultsArray[]

Is an array due to the [] at the end of the string.

 

All types of arrays can be used with procedural or object oriented coding. So in a sense it has something to do with oop, but the array itself isn't object oriented.

 

If you google search "php array formats" you won't find anything relevant to what you're asking about.

If you google search "php object oriented arrays" you'll just find arrays used in object oriented code.

 

Hope I helped.

 

Edit: It turns out I know nothing and need to go back to school, I'm very close-minded and need to open up to new ideas and methods.

 

This guy has a class ( object ) which behaves like an array, so in a sense it's an object oriented array:

http://phpadvent.org/2011/better-object-oriented-arrays-by-ryan-parman

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.