1

have an array like this

$dragonball = [
    [
        "respondent" => "Son go",
        "question1" => "95",
        "question2" => "90",
        "question3" => "80"
    ],
    [
        "respondent" => "Son gohan",
        "question1" => "85",
        "question2" => "80",
        "question3" => "95"
    ],
    [
        "respondent" => "Son go",
        "question1" => "75",
        "question2" => "90",
        "question3" => "90"
    ]
];

how to find average of question 1, question2, and question3 ?

expected it will show like this average question1 => average question2 => average question3 =>

E.N.D.
  • 11
  • 1
  • You want to transpose these columns and average? I'm pretty sure this has already been asked. See how far you get with this duplicate page. Then please only ask a new question after you have made a coding attempt (and show it in your question body). I acknowledge that your first column cannot be summed/averaged, so you will need to remove/ignore that column when processing. – mickmackusa Oct 31 '22 at 01:56

0 Answers0