Welcome Guest, Not a member yet? Register   Sign In
Add additional data to multidimensional array
#5

[eluser]trta911[/eluser]
Very thanks again, but I inspected, other problem with array, value of added key is calculated with another key's value from this array. works perfect, but gives me same value for each of them.

Better: I pass to function 'id'(value that is in array) and this function gives me something else based on this 'id'. But as note erlier, this function returns to whole array same value.


EDIT: sory, i found that is fully working with this (modified erlier post):

Code:
// $array is the array mentioned above
$length = size($array);
for ( $i = 0; $i < $length; $i++ )
  $array[$i]['something i need to add'] = $this->function_to_call_to_get_it_added($array[$i]['existing_key_from_array']);
end


Messages In This Thread
Add additional data to multidimensional array - by El Forum - 09-28-2012, 05:32 AM
Add additional data to multidimensional array - by El Forum - 09-28-2012, 06:26 AM
Add additional data to multidimensional array - by El Forum - 09-28-2012, 06:37 AM
Add additional data to multidimensional array - by El Forum - 09-28-2012, 06:38 AM
Add additional data to multidimensional array - by El Forum - 09-28-2012, 07:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB