Created
August 11, 2016 16:56
-
-
Save leurdo/9ac640e275a22ab0f9f8738704cc3727 to your computer and use it in GitHub Desktop.
Задание на подготовку к курсу PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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