-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
76 lines (52 loc) · 1.73 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<h1>PHP Class 1</h1>
<p>
<?php
// FIRST TASK
echo "<p>Hello from PHP</p>";
// SECOND TASK
$word1 = 'twinkle';
$word2 = 'star';
echo "<p>$word1, $word1 little $word2</p>";
// THIRD TASK
$x = 10;
$y = 7;
echo "<span>$x + $y = </span>" . ($x + $y);
echo "<span> $x - $y = </span>" . ($x - $y);
echo "<span> $x * $y = </span>" . $x * $y;
echo "<span> $x / $y = </span>" . $x / $y;
echo "<span> $x % $y = </span>" . $x % $y;
// FOURTH TASK
$value = 8;
echo "<span>Value is now $value. Add 2. Value is now </span>" . ($value = $value + 2);
echo "<span>. Subtract 4. Value is now </span>" . ($value = $value - 4);
echo "<span>. Multiply by 5. Value is now </span>" . ($value = $value * 5);
echo "<span>. Divide by 3. Value is now </span>" . ($value = $value / 3);
echo "<span>. Increment value by one. Value is now </span>" . ($value = $value + 1);
echo "<span>. Decrement value by one. Value is now </span>" . ($value = $value - 1);
echo "<span>.</span>";
echo "<br><br>";
// FIFTH TASK
// string(5) "Harry" Harry int(28) NULL
$name = "Harry";
$name2 = "Harry";
$num = 28;
var_dump($name);
var_dump($num);
// SIXTH TASK
$around="around";
echo '<p>What goes $around, comes $around</p>';
//SEVENTH TASK
?>
</p>
</body>
</html>