Tagged Questions
0
votes
2answers
23 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
5answers
65 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
28 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
32 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
19 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
52 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
44 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
81 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
84 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
43 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
174 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
201 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
481 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
243 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
67 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 ...