php 소스 수정 문제 입니다. ^^;;

<?
// 파일 출력
for ($i=0; $i<=count($view[file]); $i++) {
if ($view[file][$i][view]) {
$image_file="{$view[file][$i][view]}"; //<P>태그 삭제
$image_pos="&lt;그림".($i+1)."&gt;";
$image_pos2="<그림".($i+1).">"; //추가
//수정
if( strstr($view[wr_13],$image_pos) || strstr($view[wr_13],$image_pos2) ){
$pattern="/($image_pos|$image_pos2)/";

$view[wr_13]=preg_replace($pattern,$image_file,$view[wr_13]);
}
else echo $view[file][$i][view] . "<p>";
}
}
?>


위의 소스같은 경우에는 wr_13 필드에서만 작용되는데,

이것을 wr_14, wr_15 그외에 여러 필드에서도 사용하게 하려면,

어느 부분을 수정해야 하나요? ^^;; 부탁드립니당 ^^
|

댓글 2개

//수정
if( strstr($view[wr_13],$image_pos) || strstr($view[wr_13],$image_pos2)
|| strstr($view[wr_14],$image_pos) || strstr($view[wr_14],$image_pos2)
|| strstr($view[wr_15],$image_pos) || strstr($view[wr_15],$image_pos2) ){
$pattern="/($image_pos|$image_pos2)/";

$view[wr_13]=preg_replace($pattern,$image_file,$view[wr_13]);
$view[wr_14]=preg_replace($pattern,$image_file,$view[wr_14]);
$view[wr_15]=preg_replace($pattern,$image_file,$view[wr_15]);
}
감사합니다. 적용하니깐 문제없이 잘되네요 ^^ 감사합니다 ^^
댓글을 작성하시려면 로그인이 필요합니다. 로그인

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
19년 전 조회 1,523
19년 전 조회 1,580
19년 전 조회 2,754
19년 전 조회 1,528
19년 전 조회 1,586
19년 전 조회 1,268
19년 전 조회 1,467
피터팬
19년 전 조회 1,649
19년 전 조회 1,254
19년 전 조회 1,429
19년 전 조회 1,255
19년 전 조회 1,651
19년 전 조회 1,474
19년 전 조회 1,569
19년 전 조회 1,550
19년 전 조회 2,071
19년 전 조회 1,520
19년 전 조회 1,502
19년 전 조회 1,517
19년 전 조회 1,514
🐛 버그신고