1

I have an array that is produced from a mysql query:

Array ( [0] => AA [alleles] => AA [1] => 6 [total] => 6 [2] => 25.00 [percentage] => 25.00 ) 
Array ( [0] => AG [alleles] => AG [1] => 11 [total] => 11 [2] => 45.83 [percentage] => 45.83 ) 
Array ( [0] => GG [alleles] => GG [1] => 7 [total] => 7 [2] => 29.17 [percentage] => 29.17 )

How do I parse this data with php to show:

   AA 25%
   AG 45.83%
   GG 29.17%
1
  • I am confused what is the key/index => value here? Commented Mar 27, 2015 at 18:00

1 Answer 1

1

Looks like you want to return two elements per array : elements 0 and 2

Depending on what language you are using ? it would be something like :

answer_string = Array_1[0] + " " + Array_1[2] + "%"

PS. in the future always tag your question with appropriate language to get more helpful answers (it wouldn't hurt to edit your question as such)

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for advice on tag and language

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.