我想定界符下面的代碼:定界符這個PHP,HTML
<?php
//some php
//some more php
if (some condition) {
?>
<label>CMKS1<?php echo $CMKS1_CMKS2_space; ?>CMKS2</label>
<input name="cmks1" type="text" class="base-cls <?php if ($err1) echo "err-cls"; ?>" />
<input name="cmks2" type="text" class="base-cls <?php if ($err2) echo "err-cls"; ?>" />
<?php
}//if
//some final php here
?>
,但我卡上的標籤行$CMKS1_CMKS2_space
變量和2,如果條件語句中input name cmks1 and cmks2
。 heredoc格式能夠優雅地處理這些格式嗎?例如,在定界符標籤行應該是這樣的:
<label>CMKS1$CMKS1_CMKS2_spaceCMKS2</label>
,或者我應該執行一個額外的自由裁量空間:
<label>CMKS1 $CMKS1_CMKS2_space CMKS2</label>
至於在2個輸入行,如果條件語句,我甚至不知道如何移植這些...
TIA
它爲什麼需要在heredoc形式? – jmucchiello 2009-10-12 02:48:32