테스트 사이트 - 개발 중인 베타 버전입니다

explode 함수로 나타난 배열을 다른 변수에 안담고 바로 나탈낼수 있는 방법이 있나요?

퍼레버의리 10년 전 조회 10,586

</strong><code class="plain" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;"><td width=</code><code class="string" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">"22%"</code><code class="plain" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">> <?=</code><code class="functions" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; color: rgb(255, 20, 147) !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">explode</code><code class="plain" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">(</code><code class="string" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; color: blue !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">";"</code><code class="plain" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">,</code><code class="variable" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; color: rgb(170, 119, 0) !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">$view</code><code class="plain" style="line-height: 13.1999998092651px; font-size: 12px; margin: 0px !important; padding: 0px !important; border: 0px !important; outline: 0px !important; float: none !important; vertical-align: baseline !important; position: static !important; left: auto !important; top: auto !important; right: auto !important; bottom: auto !important; height: auto !important; width: auto !important; font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; min-height: inherit !important; background-image: none !important; background-attachment: initial !important; background-color: rgb(255, 255, 255); background-size: initial !important; background-origin: initial !important; background-clip: initial !important; background-position: initial !important; background-repeat: initial !important;">[wr_shell]);?></td></code><strong style="font-family: 돋움, dotum, helvetica; font-size: 12px; line-height: 21.6000003814697px; background-color: rgb(255, 255, 255);">​

 

$view[wr_shell]) 이라는 변수를 

 

explode 통해서 배열로 나눠서 각각 저장 하게 되는데요 

 

통상적으로 explode  하고 나면 

 

$변수 = explode(";",$view[wr_shell]); 

 

할텐데 $변수에 안담고 

 

view페이지에서 바로 배열의 해당되는 저장된 값만 출력할수 없나요? 

 

제가 고민한것은 

 

<td width="22%"> <?=explode(";",$view[wr_shell])[0];?></td> 

 

이렇게 해보았는데 당연 오류가 나오네요 ㅠ,ㅠ 

 

무슨 방법이 없을까요?

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

10년 전

변수에 넣고 뺴는게 맞지싶은데 궂이 변수에 넣지않고 원하는 값을 뽑아야 될

이유가 있나여? 

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전

$view[wr_shell] = "10;20;30;40";

echo pos(explode(";",$view[wr_shell]));

요 예제처럼 함수안에 안넣고는 방법이 없을거 같은데용. 걍 변수에 저장해놓고 쓰심이...

 

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

10년 전

</strong></p><p>print_r(explode(";",$view[wr_shell]));</p><p><strong>
 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

퍼레버의리
10년 전
배열 전체로 출력하는거 말고 배열 안에 제가 원하는 저장값을 출력하고 싶은데 이것은 방법이 없나요?

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인