Source
<?php
echo
"<br>Avec la méthode for <br>"
;
$n
=
4
;
$s
=
0
;
for
(
$i
=
1
;
$i
<=
$n
;
$i
++
)
{
$s
=
$s
+
$i
;
}
echo
"
$s
"
;
?>