I got for example a multidimensional array items with 2 dimensions. I get this array from a database, but it will fill up to 2600+ objects, but if i could some how unique this it would be around 30 objects. How to solve this?
The set up is: How i get the information:
$.getJSON(url1,function(data1)
{
for (var i in data1.layers){
$.each(data1.layers[i].legend, function( a, b ) {
for(var a in data1.layers[i].legend[a]){
$.each(data1.layers[i].legend, function( key, val ){
items.push({label: val.label, url: "long link" + val.url});
});
};
});
};
items[0].label
items[0].url
items[1].label
items[1].url
etc...
I found another stackoverflow page about this in php, but i can't get it to work in JavaScript/JQuery. Stackoverflow php solution