0

Hello im new in codeigniter please help

i have array looking like this

Array ( [1] => Array ( [A] => MEMBER EMAIL 
                       [B] => MEMBER GENDER (M/F) 
                       [C] => COMPANY ID 
                       [D] => COUNTRY 
                       [E] => DOB 
                       [F] => MOBILE NUMBER 
                       [G] => ADDRESS 
                       [H] => POINTS 
                       [I] => STATUS ) 
        [2] => Array ( [A] => [email protected] 
                       [B] => M 
                       [C] => 1 
                       [D] => Indonesia 
                       [E] => 1998-05-02 
                       [F] => 8734683784 
                       [G] => Address Here 
                       [H] => 100 
                       [I] => 1 ) 
        [3] => Array ( [A] => [email protected] 
                       [B] => F 
                       [C] => 9 
                       [D] => Singapore 
                       [E] => 1998-05-02 
                       [F] => 94598859430 
                       [G] => Address Here 
                       [H] => 10 
                       [I] => 1 ) 
      )

i want to get like this

array("MEMBER EMAIL ", "[email protected]","[email protected]")

sorry for my english thank you..

1 Answer 1

2

Hope this will work for you :

$data = 'your given array';
foreach ($data as $rows) {
   foreach ($rows as $key => $row) {
      if ($key == 'A')
      {
          $result[] = $row;
      }   
   }

}
print_r($result);

will output :

Array
(
    [0] => MEMBER EMAIL
    [1] => [email protected]
    [2] => [email protected]
)
Sign up to request clarification or add additional context in comments.

2 Comments

thanks, but the format is like this array("MEMBER EMAIL ", "[email protected]","[email protected]")
this is the same format you put it as raw and i show you as view source

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.