Jump to content
xisto Community
Jonnyabc

Assign Values To Multidimintional Array Assigning at different times

Recommended Posts

Hey...I am a little irritated at myself when I tried to debug by replacing the new file with the old file and wound up erasing some of my new code (no lectures please). Most of it is not a big deal, except one that I managed to get working with great strides and now I cannot seem to accomplish this code again.Here's the storyline:I have a function setup to accept two values and then assign them to a multidimensional array. My array is structured as follows: $a = array('b' => array(), 'c' => array()). In order for this array to accept multiple values in the lower arrays several times, I need to setup something like this (where $i is a counter): array_push($a['b'][$i], $bValue), or this: $a['b'][]=$bValue (or is it $a[]['b']=$bValue?). At the end of this function, I need to also (re)assign this to the global variable such as: $GLOBALS["a"] = $a.Like I said, I had it working before...if you know a better way, let me know. The idea is to be able to call this function a number of times in a page and then load the values later. I've got THAT part working...I just need help assigning new values to a multidimensional array.Thanks!

Edited by Jonnyabc (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.