안효원 안효원 2022-01-07
for add
@25d70722c9fbd9a0dd7799828532b4f51e1f7880
 
for.php (added)
+++ for.php
@@ -0,0 +1,32 @@
+<!doctype html>
+<html lang="ko">
+<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>for</title>
+    <style>
+        #page {margin: 0 auto; background-color: antiquewhite; width: 720px;}
+        #sector {width: 30%; float: left; background-color: antiquewhite; text-align: center; border: 1px black solid;}
+    </style>
+</head>
+<body>
+    <div id="page">
+        <?php
+            for($i = 1; $i<=9; $i++){
+        ?>
+        <div id='sector'>
+            <?php
+                for($j = 1; $j <= 9; $j++){
+                    echo $i . "X" . $j . "=" . ($i*$j) . "<br>" ;
+                }
+            ?>
+            <br>
+        </div>
+            <?php
+                }
+            ?>
+    </div>
+</body>
+</html>(No newline at end of file)
if.php
--- if.php
+++ if.php
@@ -23,6 +23,13 @@
     <title>HTML + PHP</title>
 </head>
 <body>
-
+<?php
+   $fruits = "apple";
+   if($fruits == "apple"){
+       echo "<h1>I'm " . $fruits . "</h1>";
+   }else {
+        echo "<h1>I'm not apple</h1>";
+   }
+?>
 </body>
 </html>
Add a comment
List