echo문 안에 넣어야 하는데 너무 어려워서요 ㅠㅠ

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!
echo문 안에 넣어야 하는데 너무 어려워서요 ㅠㅠ

QA

echo문 안에 넣어야 하는데 너무 어려워서요 ㅠㅠ

본문

<div class="sod_frm_point">
                    <div>
                        <label for="od_temp_point">사용 포인트(<?php echo $point_unit; ?>점 단위)</label>
                        <input type="hidden" name="max_temp_point" value="<?php echo $temp_point; ?>">
                        <input type="text" name="od_temp_point" value="0" id="od_temp_point"  size="7"> 점
                    </div>
                    <div id="sod_frm_pt">
                        <span><strong>보유포인트</strong><?php echo display_point($member['mb_point']); ?></span>
                        <span class="max_point_box"><strong>최대 사용 가능 포인트</strong><em id="use_max_point"><?php echo display_point($temp_point); ?></em></span>
                    </div>
                </div>

 

이 부분을 echo문 안에다 넣으려고 하는데 정말 너무 어려워서 자문좀 구하려 합니다. ㅠㅠ 

이 질문에 댓글 쓰기 :

답변 3

echo 는 단순 변수 출력 함수인데.

저 소스를 어떻게 하시고 싶으신건가요?

소스를 에코문에다 넣으려고 한거였는데 중간중간 <?php가 들어가고 해서 좀 어려워서요 ㅠㅠ 아예 div문에다 <?php if ($member['mb_level'] == 3) { echo "style='display:none;'"; } ?> 이렇게 넣었더니 조건이 완성되는 것같아서 이렇게 진행하였습니다 ㅎ 무방하겠죠 ㅠㅠ? ㅎ


echo '내용';


?>내용<?php

 

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

 


PHP 코드 내에서 내용 출력하기
<?php
 
$display_point1 = display_point($member['mb_point']); // 미리 할당
$display_point2 = display_point($temp_point);
 
echo <<<HTML
<div class="sod_frm_point">
    <div>
        <label for="od_temp_point">사용 포인트({$point_unit}점 단위)</label>
        <input type="hidden" name="max_temp_point" value="{$temp_point}">
        <input type="text" name="od_temp_point" value="0" id="od_temp_point"  size="7"> 점
    </div>
    <div id="sod_frm_pt">
        <span><strong>보유포인트</strong>{$display_point1}</span>
        <span class="max_point_box"><strong>최대 사용 가능 포인트</strong><em id="use_max_point">{$display_point2}</em></span>
    </div>
</div>
HTML;

$text='<div class="sod_frm_point">';
$text.='<div>';
$text.='<label for="od_temp_point">사용 포인트( ' . $point_unit . ' 점 단위)</label>';
echo $text;

 

변수에다 html과 php 코드를 다 넣어서 echo 로 출력해야 하는데

이정도면 if 문으로 처리하시는게 나을 것 같네요

답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT