답변 3개
채택된 답변
+20 포인트
9년 전
페이지별로 변수나 상수를 지정해줍니다. 그페이지가 상수나 변수가 일치할경우 특정 제목으로 노출
<?php <span style="font-size: 14.6667px; line-height: 1.5;">$lang = 'jp'; // 페이지 언어셋을 일본으로 지정</span><span style="font-size: 11pt; line-height: 1.5;"> ?></span></p><p><span style="font-size: 11pt; line-height: 1.5;"> </span></p><p><?php</p><p><span style="font-size: 14.6667px; line-height: 22px;">switch(</span><span style="font-size: 14.6667px; line-height: 1.5;">$lang</span><span style="font-size: 14.6667px;">)</span></p><p><span style="font-size: 14.6667px;">{</span></p><p><span style="font-size: 14.6667px;"> case "ko": </span><span style="font-size: 11pt; line-height: 1.5;">echo </span><span style="font-size: 14.6667px;">$list [ $i ][subject]; </span><span style="font-size: 14.6667px;">break;</span></p><p><span style="font-size: 14.6667px; line-height: 1.5;"> // 언어셋이 한국일경우 기본제목으로 출력</span></p><p><span style="font-size: 11pt; line-height: 1.5;"> </span><span style="font-size: 14.6667px; line-height: 1.5;">case "us": </span><span style="font-size: 11pt; line-height: 1.5;">echo </span><span style="font-size: 14.6667px;">$list[$i]['wr_1'];</span><span style="font-size: 14.6667px;"> </span><span style="font-size: 14.6667px;">break;</span></p><p><span style="font-size: 14.6667px;"></span><span style="font-size: 14.6667px;"> // 언어셋이 미국일경우 </span><span style="font-size: 14.6667px; line-height: 1.5;">1번 </span><span style="font-size: 11pt; line-height: 1.5;">여분필드로 출력</span></p><p><span style="font-size: 11pt; line-height: 1.5;"> </span><span style="font-size: 14.6667px; line-height: 1.5;">case "jp": </span><span style="font-size: 11pt; line-height: 1.5;">echo </span><span style="font-size: 14.6667px;">$list[$i]['wr_2'];</span><span style="font-size: 14.6667px;"> </span><span style="font-size: 14.6667px;">break;</span></p><p><span style="font-size: 14.6667px;"> // 언어셋이 일본일경우 2</span><span style="font-size: 14.6667px; line-height: 1.5;">번 </span><span style="font-size: 11pt; line-height: 1.5;">여분필드로 출력</span></p><p><span style="font-size: 11pt; line-height: 1.5;">}</span></p><p><span style="font-size: 11pt; line-height: 1.5;">?></span></p><p> </p><p>// 결과는 <span style="font-size: 14.6667px;">2</span><span style="font-size: 14.6667px; line-height: 1.5;">번 </span><span style="font-size: 11pt; line-height: 1.5;">여분필드로 출력됩니다.</span></p><p><span style="font-size: 11pt; line-height: 1.5;"> </span></p><p><span style="font-size: 14.6667px;">
로그인 후 평가할 수 있습니다
답변에 대한 댓글 1개
a
angpang
9년 전
감사합니다..^^ 적용해볼께요..^^
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인