<?php
$sum = 0;
for ($i = 2; $i <= 10; $i += 2) {
$sum += $i;
}
echo "The sum of even numbers between 1 and 10 is: $sum";
?>
<?php
$sum = 0;
for ($i = 2; $i <= 10; $i += 2) {
$sum += $i;
}
echo "The sum of even numbers between 1 and 10 is: $sum";
?>
Related
Write a PHP function to check if a given string is a palindrome |
what is PhpUnit? |
How to reverses a given string using PHP. |
Write a PHP script that checks if a given string is a valid email address. |
Write a PHP function that throws a custom exception if a condition is not met. |
Create a PHP script that checks whether a given number is a prime number or not. |
Create a PHP script that processes a form submission and displays the submitted data. |
how can i solve php header errors? |
