Questions tagged [associative]

This tag is used mostly regarding associative arrays (but better use tag "associative-array" for that) and sometimes in the mathematic sense of tag "associativity", the associative property of binary operations.

435 questions
0
votes
1 answer

adding more arrays into existing php associative array

By default, $arrDummy already have some existing data inside it. I want to add in additional family into existing $arrDummy By calling getnewfamily(), I will add multiple small values into the same family name, then return back to main function and…
i need help
  • 2,386
  • 10
  • 54
  • 72
0
votes
4 answers

javascript: how to find the key in an associative array that is closest to a value?

i have something like var keyVals = Array; keyVals['23'] = 234; keyVals['58'] = 'sunshine'; keyVals['172'] = 'lolipops'; newVar = 76; how can i find which of the keys in the array is closest in value (once made into numbers) to my newVar? which…
skrite
  • 317
  • 4
  • 18
0
votes
5 answers

php simple associative array

I've done this a million times but for some reason I can't get this to work today... I have this associative array Array ( [0] => stdClass Object ( [registrantKey] => 106569618 [firstName] => xxx …
matt
  • 2,312
  • 5
  • 34
  • 57
0
votes
1 answer

PHP - Search one associative array with an array of values, then create a new array with matching results

I have one associative array as follows: { "organizations":[ { "name":"10sheet", "owner_name":"Me" }, { "name":"12Gigs", "owner_name":"Me" }, "name":"24\/7 Card", "owner_name":"Me as well" …
Greg
  • 89
  • 1
  • 9
0
votes
1 answer

javascript unique key values in array of objects

I need to find out, is there in array of objects object with the certain key:value For example if I need the key 'id' to be unique: arr=[ {id:1, attr1:'435',attr2:'sdg'}, {id:2, attr3:'4x35',attr2:'sdg'} …
2oppin
  • 1,941
  • 20
  • 33
0
votes
2 answers

Data structure for storing debugging symbols

I need to store all debugging symbols (for simplicity, only function names + addresses). I do not have function sizes. Like: _printf 0x1234 _fprintf 0x1255 _scanf 0x1300 I need a very fast algorithm for determining function name by address, for…
user313885
0
votes
2 answers

associativity of parentheses

This msdn link says that '(' and ')' has left to right associativity. How does that make sense? Can someone give me a example?
FloydChen
  • 425
  • 1
  • 4
  • 9
0
votes
1 answer

Assoc Array manipulation - array("value1", "value2") to array(array("keyname" => "value1"), array("keyname" => "value2"))

What I'm doing is taking a basic array, with default numeric keys: $basic_array = array("value1", "value2", "value3") and I want to merge that array with an associative array set up like: $associative_array = array(array("filename" => "value4"),…
Josh L
  • 39
  • 6
0
votes
4 answers

PHP Associative Arrays - Replace --> with "as"

I know there must an easy and efficient way to do this. I have an array like this: $fields = array( "EVENT_ID" => "Event Id" , "EVENT_NAME" => "Name", "EVENT_CLASSIFICATION" => "Classification", …
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173
0
votes
3 answers

dynamic associative array creation whith jquery and xml

I'm trying to store data from a xml-file in a associative Array. Creating the array works fine but I can't access the data in other functions (i.e. checkArray()). var picSetsData = (function () { var _picSets = []; $.ajax({ type:…
rttmax
  • 344
  • 1
  • 12
-1
votes
1 answer

Looping through Associative Array as many times as the key

I'm trying to loop through an Associative Array but instead of 10 times, it loops trhrough lots of times. Also, I'm trying to keep track of how many answers the user answered correctly. I'd use post but this is cmd php so that won't be…
Janus
  • 29
  • 4
-1
votes
1 answer

Want to display associative array of php in neat 3 columns and rows

I am VERY new to PhP. Quick question that I am having trouble finding the answer to online, although I am sure most of you will quickly know the answer. I have used this PHP code to display the index name under the image and the overall view I am…
Talal
  • 9
  • 1
-1
votes
2 answers

Associative array remove all values of 0

I have an Associative array in PHP and want to remove all values which have the associated value of 0 Array ( [item1] => 0 [item2] => 10 [item5] => 0 [item10] => 10 [item12] => 5 ) Thank you
Wallchris
  • 33
  • 3
-1
votes
6 answers

how to display only billing_id from this array?

Array ( [0] => Array ( [0] => Array ( [billing_id] => 1 ) [1] => Array ( [billing_id] => 2 ) ) )…
ankur43
  • 71
  • 7
-1
votes
2 answers

Get first element of sub array as its key

I'm looking for an easy way to transform the keys of an associative array. I want the key of the sub array to be te first value of himself. Is it possible to change this : Array ( [0] => Array ( [symbol] => ETHBTC [status] =>…
William Ode
  • 188
  • 3
  • 11