Multiple items in an array?? How??

Discussion in 'PHP' started by amitash, Jan 13, 2010.

  1. #1
    Hi,
    I have two items. They are
    $cid = ea49678ab30e96367c238b1bc330996a;
    $seo_username = str_replace(" ", "-", $user['username']);

    I want to create another array that creates an md5 of these two. For example,
    $md5idkey = $seo_username ; $cid;

    How can i make it.
     
    amitash, Jan 13, 2010 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    $md5idkey = md5($seo_username.$cid);
     
    JAY6390, Jan 13, 2010 IP
  3. amitash

    amitash Well-Known Member

    Messages:
    399
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #3
    This doesnt work as the "." is also counted in the MD5. It must not be counted.
     
    amitash, Jan 13, 2010 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    lol no it is not. The . concatenates the two strings before it gets hashed
    example
    
    $word1 = 'Jay';
    $word2 = 'Gilford';
    echo md5($word1.$word2);
    echo '<br />';
    echo md5('JayGilford');
    
    PHP:
    Both output the same value
    344bd980647a7d117250fda88980e8d7
    344bd980647a7d117250fda88980e8d7
    Code (markup):
     
    JAY6390, Jan 13, 2010 IP
  5. danx10

    danx10 Peon

    Messages:
    1,179
    Likes Received:
    44
    Best Answers:
    2
    Trophy Points:
    0
    #5
    The . connects the two paremeters/values.
     
    danx10, Jan 13, 2010 IP
  6. amitash

    amitash Well-Known Member

    Messages:
    399
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    125
    #6
    Thanks JAY6390
     
    amitash, Jan 13, 2010 IP