채택완료

html 소스를 php 소스로 변경 ?

2022-01-18 (화) 10:14:48 1,934

<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개

채택된 답변
+20 포인트
2022-01-18 (화) 10:23:51
Copy
// 그냥 열고 닫기, 변수만 제대로 처리해주면 됩니다.

?><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;

BiHon 님, 답변 감사합니다. 

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