logo

Crowdly

Browser

Add to Chrome

What is the output of the following loop? PHP $nums = [1, 2, 3, 4]; ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What is the output of the following loop?

PHP

$nums

= [1, 2, 3, 4];

$total

= 0;

foreach

($nums as $n) {

 

   $total += $n;

}

echo

$total;

0%
100%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.nottingham.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome