multidimensional-array

How to Handle Consuming Lots of Data from Multiple Sources in a Web SIte

This is a "meta" question that I am asking in a effort to better understand some tough nuts I've had to crack lately. Even if you don't get precisely what I'm reaching for here or there is too much text to read through, any practical input is appreciated and probably useful. Assume you have a website that needs to use data that is store...

Help trying to generate tricky multidimensional array format

Hi guys, I'm having trouble trying to build an array in PHP which will output in the JSON format I am looking for. I will show you what I am trying to achieve and where I have got to so far: [ {"data":[{"x":3,"y":0},{"x":10,"y":0}]}, {"data":[{"x":11,"y":0},{"x":13,"y":0}]}, {"data":[{"x":12,"y":1},{"x":17,"y":1}]} ] I am ...

I need an array_keys_recursive()

$temp = array(); function show_keys($ar) { foreach ($ar as $k => $v ) { $temp[] = $k; if (is_array($ar[$k])) { show_keys ($ar[$k]); } } return $temp; } I tried using that function but it still only returns the first key. ...

Problem POSTing an multidimensional array using cURL PHP

Hello! I'm having problems posting an array using PHP cURL. I have successfully posted other values to the same page using POST-variables. But this one is hard to figure out. The only problem is how I should present the data to the server. I checked the original form using a form analyzer. And the form analyzer shows that the POST vari...

Coldfusion + Google Map API v3 ā€” info window and set bounds

Simply, I seem to be able to write code that either creates a clickable marker for a pop-up infoWindow OR gets the bounds of the returned markers and resets the map extent and zoom levels. I can't seem to combine the two. My example below will nicely set the extent of the map to the results of the query. But I don't quite know how to ...

query a mysql table for rows that have the same month value and store as a php array for later use displaying them on a calendar

the subject basically sums it up, but i am working on a calendar in php for a client that should pull events from a table and display them in the appropriate cells. the calendar table is working no prob, but what i am trying to avoid is making a separate DB call for each day of the month. i am trying to figure out a way to store the re...

I need to create 2D array in C#

Hi I need to create 2D jagged array. Think of a matrix. The number of rows is known, the number of columns is not known. For example I need to create array of 10 elements, where type of each element string[]. Why do I need that? The number of columns is not known - this function must simply do the allocation and pass array to some other...

how to initialize bidimensional array

Let's say I would like to manage a multidimensional array like (pseudo-code): Array $colors * wine,red * cheese,yellow * apple, green * pear,brown What code could be used to avoid the following notation, to initialize the array (assuming there will be a hard-coded list of elements=?: $colors[x][y] = 'something'; ...

Javascript: sort multidimensional array

After creating a multi-dim array like this, how do I sort it? Assuming 'markers' is already defined: var location = []; for (var i = 0; i < markers.length; i++) { location[i] = {}; location[i]["distance"] = "5"; location[i]["name"] = "foo"; location[i]["detail"] = "something"; } For the above example, I need to sort it by 'di...

How do I create this multidemsional Array, Hash Combo?

I have this data and i need an output like this type of output.. I basically need to have all the venues and their dates and all the songs associated to them ....if anyone can think of a better structure and how to achieve it I would be very thankful... { ["Vector Arena - Auckland Central, New Zealand" => { "2010-10-10" => ["...

There has got to be a cleaner way to do this...

I have this code here and it works but there has to be a better way.....i need two arrays that look like this [ { "Vector Arena - Auckland Central, New Zealand" => { "2010-10-10" => [ "Enter Sandman", "Unforgiven", "And justice for all" ] } }, { "Brisbane Entertainment Centre - Brisbane Qld, Aus...

PHP Two-Dimensional Associative Array Implode

I'd like to store the following array in a single text field in a mySQL table: $user_rating[0] = array('percent' => 'XXXXXXXXXXXXXXXXX', 'category' => 'Category 1', 'description' => 'XXXXXXXXXXXXXXXXX', 'link' => 'XXXXXXXXXXXXXXXXX', 'thumbnail' => 'XXXXXX...

converting string into multidimensional array

hi, I'd like to convert this string: $credit_packages_string = "300,0.25|1000,0.24|3000,0.22|4000,0.20|5000,0.18|6000,0.16|7000,0.14"; into this array: $credit_packages = array( array( 'credit_amount'=> 300, 'price_per_credit'=>0.25), array( 'credit_amount'=> 1000, 'price_per_credit'=>0.24), array( 'credit...

Implode and Explode Multi dimensional arrays

Are there any functions for recursively exploding and imploding multi-dimensional arrays in PHP? ...

Declaring a pointer to multidimensional array: C++

I've tried looking but I haven't found anything with a definitive answer. I know my problem can't be that hard. Maybe it's just that I'm tired.. Basically, I want to declare a pointer to a 2 dimensional array. I want to do it this way because eventually I will have to resize the array. I have done the following successfully with a 1D ar...

Error defining and initializing multidimensional array

I get error in compilation with the following definition. int matrix[ ][ ] = { { 1, 2, 3}, {4,5,6} }; char str[ ][ ] = { "abc", "fgh" }; Why is the compiler complaining missing subscript and too many initializers. ...

Search and match from array

Search an array - I found this function below to search an array which is "great" for single strings, it will match an array value and or array value and matching key within an array, BUT what i really want to do is ONLY match an array where ALL the search values are met/returned. the query example could return matches for any records wh...

PHP Multi-Dimensional Arrays Issue

Ok I have a mult-dimensional array which has the following structure... 0 => array ( 'membership' => array ( 'member' => array ( 'name' => '', 'landline' => '', 'libcard' => '', 'mobile' => '', 'email' => '', ), 'updated_at' => '', 'member_id' => 12345,...

Confusion about pointers and multidimensional arrays.

If the following is possible: MyFunction(int *array, int size) { for(int i=0 ; i<size ; i++) { printf(ā€œ%dā€, array[i]); } } main() { int array[6] = {0, 1, 2, 3, 4, 5}; MyFunction(array, 6); } Why the following is not? MyFunction(int **array, int row, int col) { for(int i=0 ; i<row ; i++) { ...

MATLAB coding problem

Hey guys, I got this error message when I tried to trigger the function below. Can anybody help me out? Thanks! >> changeYuv('tilt.yuv',352,288,1:40,40); ??? Index exceeds matrix dimensions. Error in ==> changeYuv at 32 j=histogram(imgYuv(:,:,1,k+1)); >> [x,y,z,a]=size(imgYuv) x = 288 y = 352 z = 3 a = 40...