Need help in PHP arrays

Discussion in 'PHP' started by balasun, Apr 4, 2009.

  1. #1
    Hello all,

    I have one two dimensional arrays

    like:

    $array=array[0]=>Array ( [0] => "Title" [1] => "First Name" [2] => "Middle Name" )[1]=>array[0]=>'Test@yahoo.com [1] => name

    In the array i just need that email Id(Test@yahoo.com) only and assign that into another array..

    Pls help me hoow do i do that?

    Thanks,
     
    balasun, Apr 4, 2009 IP
  2. AveragePro

    AveragePro Guest

    Messages:
    51
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If your array is static and the email is always going to be in the same index you can just hard code it in.

    $array2[0] = $array[1][0];
     
    AveragePro, Apr 4, 2009 IP
  3. ads2help

    ads2help Peon

    Messages:
    2,142
    Likes Received:
    67
    Best Answers:
    1
    Trophy Points:
    0
    #3
    $array[1][0] would be carrying the email id you want.

    To make it simple,

    $emailid = $array[1][0];

    Then use $emailid to assign into anotehr array.

    - ads2help
     
    ads2help, Apr 4, 2009 IP