html 소스를 php 소스로 변경 ?

html 소스를 php 소스로 변경 ?

QA

html 소스를 php 소스로 변경 ?

답변 2

본문

<img src="<?php echo $board_skin_url;?>/img/btn_carView_01.gif" alt="확인" class="first">

=> php 소스로 변경 

 

예를들어) 

<img src="'.G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file).'" alt="'.$content.'" '.$attr.'>'

 

<img src="<?php echo $board_skin_url;?>/img/btn_carView_01.gif" alt="확인" class="first">

위의 소스를 php 소스로 어떻게 변경하나요?

감사합니다. 

이 질문에 댓글 쓰기 :

답변 2


// 그냥 열고 닫기, 변수만 제대로 처리해주면 됩니다.
?><img src="<?=$board_skin_url?>/img/btn_carView_01.gif" alt="확인" class="first"><?php
 
// 바로 출력
echo '<img src="', $board_skin_url, '/img/btn_carView_01.gif" alt="확인" class="first">';
 
// 변수에 할당
$img = '<img src="'.$board_skin_url.'/img/btn_carView_01.gif" alt="확인" class="first">';
 
// 바로 출력
printf('<img src="" alt="" %s">', G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file), $content, $attr);
 
// 변수에 할당
$img = sprintf('<img src="" alt="" %s">', G5_DATA_URL.'/file/'.$board['bo_table'].'/'.urlencode($file), $content, $attr);
 
// 바로 출력
echo <<<HTML
<img src="{$board_skin_url}/img/btn_carView_01.gif" alt="확인" class="first">
HTML;
 
// 변수에 할당
$img = <<<HTML
<img src="{$board_skin_url}/img/btn_carView_01.gif" alt="확인" class="first">
HTML;
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로