Skip to content

Instantly share code, notes, and snippets.

@leurdo
Created August 11, 2016 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leurdo/9ac640e275a22ab0f9f8738704cc3727 to your computer and use it in GitHub Desktop.
Save leurdo/9ac640e275a22ab0f9f8738704cc3727 to your computer and use it in GitHub Desktop.
Задание на подготовку к курсу PHP
<!DOCTYPE html>
<html lang="ru-RU">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width">
<title>Вводное ДЗ по курсу PHP</title>
</head>
<body>
<?php
/* Задание 1 */
$a = 2;
$b = rand(1, 100);
echo 'Результат сложения 2 и случайного числа - '.($a + $b). '<br>';
/* Задание 2 */
echo 'Четные числа от 1 до 10 <br>';
for ($i = 1; $i <= 10; $i++) {
if ($i%2 == 0) echo $i.' ';
}
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment