how to make a loop that adds numbers to a variable in php
<?php
$start = 1;
$end = 10;
$sum = 0;
for ($i = $start; $i <= $end; $i++) {
$sum += $i;
}
echo "Sum from " . $start . " to " . $end . " = " . $sum;
how to make a loop that adds numbers to a variable in php
<?php
$start = 1;
$end = 10;
$sum = 0;
for ($i = $start; $i <= $end; $i++) {
$sum += $i;
}
echo "Sum from " . $start . " to " . $end . " = " . $sum;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us