Join array

Discussion in 'PHP' started by Gins Babu, Nov 26, 2009.

  1. #1
    Hi,

    Hi..

    i have an associative array with the n number of values of which one array name is location id.If location ID is having the same value in all the inner arrays i want to combine the results of the array ie having the same value.Any one knows solution for this.The purpose is like if the count is same and location id present are two 1's and one 2's then the corresponding values in 1's should be appended?how can i do this?
     
    Gins Babu, Nov 26, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you give a simple example of the array(s) and what you want as a result?
     
    JAY6390, Nov 26, 2009 IP
  3. xenon2010

    xenon2010 Peon

    Messages:
    237
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    from what I understand. you need to use array_unique
     
    xenon2010, Nov 27, 2009 IP
  4. Pirata Nervo

    Pirata Nervo Greenhorn

    Messages:
    45
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #4
    @xenon2010 array_unique doesn't append anything
    @Gins Babu, we need more details, for example, two sample arrays like:
    array (
    blabla => test
    blablabla1 => hello
    )

    and

    array (
    hey => hihi
    bye = byehey
    blabla => joinme
    )

    and the end result of the merging, something like:
    array (
    hey => hihi
    bye = byehey
    blabla => testjoinme
    blablabla1 => hello
    )

    Not sure if this is what you're trying to say, but I'll wait until you reply to give you an answer.
     
    Pirata Nervo, Nov 27, 2009 IP
  5. Gins Babu

    Gins Babu Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #5
    Hi all,

    Thanks for your responses...i have solved that issue.
     
    Gins Babu, Nov 27, 2009 IP