+++ for.php
... | ... | @@ -0,0 +1,32 @@ |
1 | +<!doctype html> | |
2 | +<html lang="ko"> | |
3 | +<head> | |
4 | + <meta charset="UTF-8"> | |
5 | + <meta name="viewport" | |
6 | + content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
7 | + <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
8 | + <title>for</title> | |
9 | + <style> | |
10 | + #page {margin: 0 auto; background-color: antiquewhite; width: 720px;} | |
11 | + #sector {width: 30%; float: left; background-color: antiquewhite; text-align: center; border: 1px black solid;} | |
12 | + </style> | |
13 | +</head> | |
14 | +<body> | |
15 | + <div id="page"> | |
16 | + <?php | |
17 | + for($i = 1; $i<=9; $i++){ | |
18 | + ?> | |
19 | + <div id='sector'> | |
20 | + <?php | |
21 | + for($j = 1; $j <= 9; $j++){ | |
22 | + echo $i . "X" . $j . "=" . ($i*$j) . "<br>" ; | |
23 | + } | |
24 | + ?> | |
25 | + <br> | |
26 | + </div> | |
27 | + <?php | |
28 | + } | |
29 | + ?> | |
30 | + </div> | |
31 | +</body> | |
32 | +</html>(No newline at end of file) |
--- if.php
+++ if.php
... | ... | @@ -23,6 +23,13 @@ |
23 | 23 |
<title>HTML + PHP</title> |
24 | 24 |
</head> |
25 | 25 |
<body> |
26 |
- |
|
26 |
+<?php |
|
27 |
+ $fruits = "apple"; |
|
28 |
+ if($fruits == "apple"){ |
|
29 |
+ echo "<h1>I'm " . $fruits . "</h1>"; |
|
30 |
+ }else { |
|
31 |
+ echo "<h1>I'm not apple</h1>"; |
|
32 |
+ } |
|
33 |
+?> |
|
27 | 34 |
</body> |
28 | 35 |
</html> |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?