2026 년 4 월

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

 
그누스킨 그누소스 소스변경 소스문법 홈준비 기타
 
작성일 : 07-02-03 12:47
[소스문법] 제어 구조의 대체 문법
 글쓴이 : Morning (124.♡.110.84)
조회 : 5,572  
PHP는 제어 구조를 위해 대체 문법을 제공한다; 즉 if, while, for, foreach, 그리고 switch. 각 경우에 대체 문법의 기본형태는 괄호열기를 콜른 (:)으로 대체하고 괄호닫기는 각각 endif;, endwhile;, endfor;, endforeach;, 또는 endswitch;으로 대체한다.

<?php if ($a == 5): ?>
A는 5와 같다
<?php endif; ?> 

위 예에서는 대체 문법으로 쓰여진 if구문안에 "A는 5와 같다" HTML 블록이 포함되어있다. 이 HTML 블록은 $a가 5와 같을때만 출력될것이다.

대체 문법은 else와 elseif문에도 적용이 된다. 다음은 elseif와 else문 과 같이 있는 if문 절의 대체 형태이다:

<?php if ($a == 5): ?>
A는 5와 같다
<?php endif; ?> 

위 예에서는 대체 문법으로 쓰여진 if구문안에 "A는 5와 같다" HTML 블록이 포함되어있다. 이 HTML 블록은 $a가 5와 같을때만 출력될것이다.

대체 문법은 else와 elseif문에도 적용이 된다. 다음은 elseif와 else문 과 같이 있는 if문 절의 대체 형태이다:

주님과 함께 모닝커피를

 
 

Total 37
번호 제   목 글쓴이 날짜 조회
37 [소스문법] 심볼릭링크없이, 두개의 그누보드에서 data폴… Morning 07-19 9614
36 [소스문법] 스타일이용하여 라운딩만들기 Morning 03-06 5604
35 [소스문법] 리다이렉트 (3) Morning 02-27 6983
34 [소스문법] 보더 입력방법 Morning 03-12 5631
33 [소스문법] 일정한 부분을 다른 것으로 치환하는 방법 (9) Morning 02-22 6531
32 [소스문법] div, table (2) Morning 01-20 5522
31 [소스문법] dq_thumb_engine2를 쓴 최신글스킨에서 썸네일 안… (1) Morning 02-04 5552
30 [소스문법] include() (5) Morning 02-03 7100
29 [소스문법] 제어 구조의 대체 문법 Morning 02-03 5573
28 [소스문법] elseif Morning 02-03 5489
27 [소스문법] else Morning 02-03 5534
26 [소스문법] if (2) Morning 02-03 5989
25 [소스문법] for (1) Morning 02-03 5437
24 [소스문법] 흐르는 글 Morning 01-31 5355
23 [소스문법] 보더를 이용해서 box 만들기 Morning 01-26 5671
 1  2  3  

Therefore, holy brothers, who share in the heavenly calling,
fix your thoughts on Jesus, the apostle and high priest whom we confess.
Let us fix our eyes on Jesus, the author and perfecter of our faith,
who for the joy set before him endured the cross, scorning its shame,
and sat down at the right hand of the throne of God