본문 바로가기
PHP

for문

by 스윗라이프 2017. 7. 22.

// for문

<html>

<body>

<table border='1'width='300'>   

<tr align='center'><td width'150'>섭씨</td><td>화씨</td></tr>

<?

    for ($c=-15; $c<=35; $c=$c+5)

    {

          $f = $c * 9 / 5 + 32;

          echo "<tr align='center'><td>$c</td><td>$f</td></tr>";

}

?>

</table>

</body>

</html>


/////

<?

   for ($i=1; $i <= 10; $i++)

   {

   echo "$i<br>";    // $i를 화면에 출력하고 줄바꿈

}

?>




http://moa.pe.kr

'PHP' 카테고리의 다른 글

if ~else  (0) 2017.07.22
do~while  (0) 2017.07.22
setcookie  (0) 2017.07.22
session  (0) 2017.07.22
delete  (0) 2017.07.22

댓글