-2
votes
1answer
24 views

javaqscript: 2d associative arrays 101

This is my first Q&A ever, so hopefully it's alright. As someone who generally picks stuff up quickly, I found the information on this topic was sporadic and generally over complicated, with many ...
0
votes
1answer
23 views

How to access a specific key-value from multidimensional array in smarty?

I'm a newbie in smarty. Having problems in accessing multidimensional array in smarty template. My current issue is as follows. Following is may array named $request : Array ( [form_submitted] ...
0
votes
3answers
58 views

What's the error in my foreach loop?

Following is my multidimensional array named $prev_map_data: Array ( [0] => Array ( [class_id] => 2 [class_name] => II [class_checked] => 1 ...
0
votes
2answers
40 views

What's the error in my foreach loop over multidimensional array?

Following is my multidimensional array named $prev_map_data: Array ( [0] => Array ( [class_id] => 2 [class_name] => II [class_checked] => 1 ...
2
votes
2answers
41 views

How to access the values from inner key of associative array in PHP?

Following is may multidimensional array named $form_data: Array ( [form_submitted] => yes [teacher_id] => 3807f31f8c4357bbb56662047529dcde [cs_map_ids] => Array ( ...
0
votes
3answers
43 views

How to change the keys of multidimensional array in PHP?

My multidimensional array named $cs_map_data is as follows : Array ( [2] => Array ( [class_id] => 2 [class_name] => II [class_checked] => 0 ...
-1
votes
3answers
55 views

How to insert a new key-value pair in an associative array in PHP? [closed]

I've an associative array named $classes_data as follows: Array ( [2] => Array ( [class_id] => 2 [class_name] => II [subjects] => Array ...
0
votes
1answer
39 views

How to insert a new key and value in multidimensional array?

Following is the output of my multidimensional array $csmap_data Array ( [0] => Array ( [cs_map_id] => 84 [cs_subject_id] => 1 ) [1] => ...
0
votes
1answer
10 views

I need to sort by price, and then by time for identical prices multidimensional associated array

I need to sort by price, and then for things with identical prices. I have the sort by price. Here is the array and sort that I have: <?php $a = array( 1 => array('price' => ...
0
votes
4answers
51 views

Ordering multidimensional associative arrays

I want to order this array by price AND keep my keys without them being changed. Here is what I have been working with. <?php $a = array( ...
1
vote
4answers
83 views

php, mysql - Combine result into multidimension associate array

I have the following MySQL database : | id | sessionId | time | |------------|-------------|---------------------| | 54 | 4 | 2013-03-23 ...
1
vote
3answers
134 views

Create new multidimensional Associative array from 2 arrays

I am looking for a solution to create a single multidimensional associate array in javascript. What I have: I have a mysql database I am accessing with php and have an array containing all fields ...
0
votes
2answers
33 views

PHP Array Grouping on Sponsor Year

I am attempting to generate a grouped array. Here is my code: function group_assoc($array, $key) { $return = array(); foreach($array as $v) { $return[$v[$key]][] = $v; } return $return; } Here ...
5
votes
4answers
78 views

re arrange php associative array

I have an array: $example = array(); $example ['one'] = array('first' => 'blue', 'second' => 'red'); $example ['two'] = array('third' => 'purple', ...
0
votes
2answers
38 views

Associative subarrays in Javascript

How can the equivalent in PHP be done in JS?: $this->gridColumnData[] = array('field' => 'id', 'width' => 50, 'title' => 'Enquiry Id') ; $this->gridColumnData[] = array('field' => ...
0
votes
2answers
40 views

implode logic not working as expected

So I am building off of this question about multidimensional associative array of arrays. and what I came up with is a really simple and easy way to solve my problem. The following array: $options = ...
0
votes
1answer
35 views

Could use some advice on jquery each function on a associative multidimensional array.

I'm working on a jquery .get that will send a value to the server to compare against an array which will then get encoded into a json format as the responses. Below is the code ( jquey and PHP zend). ...
0
votes
2answers
92 views

How to choose the proper array in java to store XML data

I am new to Java and trying to create a cataloging program as a beginning exercise. I've made the interface and I can populate the initial JComboBox with the titles the way I want but my issue comes ...
0
votes
1answer
49 views

Sorting a multi-dimentsional associative array of arrays

Like the title sais I have no idea where to start and using asort() and sort() are not helping in the way I thought it would. Essentially I have an array as such: $array = array( 'array_c' => ...
0
votes
2answers
114 views

Creating associative array in a for-loop

I have a big xml document that i'm trying to process into an array in javascript. <DR> <C> <SWDGDRC> <CID>0</CID> <V>06/01/2012 ...
-1
votes
3answers
92 views

spliting one array into 3 different arrays [closed]

I have an php array. I want to split this array into 2 arrays. please see below example:- $arrayIhave = array ( 'id' => '1', 'name' => 'ripa', 'roll' => '10', 'country' => ...
0
votes
1answer
63 views

Check for an array's key existing as a another arrays value

I have a array called $menu_array; and currently looks like this [0] => Array ( [id_parent_menu] => 4 [parent_info] => test [children_menu] => Array ...
0
votes
2answers
280 views

Jquery creating associative array with dynamic keys and multiple values

Trying to create the following: array( '12345' => 'A01', 'A02', 'A03' '22222' => 'B01', '33333' => 'C01', 'C02') So basically each key is different generated dynamically from another ...
1
vote
3answers
275 views

Implementing multidimensional associative arrays in Common Lisp

I'm looking for the best way to implement multidimensional associative arrays in Common Lisp. I'm using SBCL. For example in MATLAB, I can create a struct array like this, eg. with some geographical ...
3
votes
2answers
782 views

Create PHP multidimension associative array from MySQL linked tables SELECT query

I'm hoping someone could help me with this problem. Say I have 3 DB tables: Users: user_id, user_name 100, John 101, Jessica Cars: car_id, car_name 30, Corvette 31, BMW UsersCars: user_id, ...
0
votes
2answers
1k views

PHP combine two associative arrays into one array

$array1 = array("$name1" => "$id1"); $array2 = array("$name2" => "$id2", "$name3" => "$id3"); I need a new array combining all together, i.e. it would be $array3 = array("$name1" => ...
0
votes
1answer
87 views

Sorting multidimensional array in third level

In the array below you can see that the order of 'listElemId' differs from the three first elements in the array. What I want is them to be in order (listElem 1,2,3). 'listElemPoints' should of course ...
1
vote
3answers
124 views

need efficient restructuring of a complicated PHP assoc array [closed]

In my data mining project, I'm given a complicated, huge multidemensional array of arrays that contains all the info I require, except that I have to perform a "fix" on it before I can process it. ...
0
votes
3answers
167 views

Array_splice to swap an element with previous in a multidimensional associative array [closed]

Swap-up element in a multidimensional array with the sibling above it. I want the element with the selected index in the array to swap it's position with the one above him. The element from it's ...
1
vote
4answers
190 views

Sorting a value pair in Javascript

I must be missing the proper term or else I'm sure I could find the answer by searching... in any case, here's what I want to do. Through javascript, I get four variables (A, B, C, and D) that I ...

1 2 3
15 30 50 per page