2011-11-27 80 views
3

我真的很陌生,并且无法调试下面的代码片段。PHP片段不能正常工作

<?php 
$hintMaintain = <<< EOT 
    <hr /> 
    <div id="user_hint"> ABC DE <span class="status_strtolower($account['status_value'])">ucfirst($account['status_value'])</span>FGH</div> 

    <div style="margin: 0px 74px 0px 74px; text-align: center; height: 66px; width:66px; background: url('img/strtolower($maintain)hint.png') no-repeat;"> 
     <span style="line-height: 66px; font-size: 36px; color: black;">$countdown</span> 
    </div> 
EOT; 

eval("\$hintMaintain = \"$hintMaintain\";"); 
?> 
<!-- SOME HTML --> 

<?php echo $hintMaintain; ?> 

这显示服务器错误。我一直无法解决这个问题。

帮助? 谢谢。

+0

什么是服务器错误? –

+0

大的stinkin santax错误。你怎么错过了? –

回答

3

尝试:

<?php 
$hintMaintain = '<hr /> 
<div id="user_hint"> 
    <p> ABC DE 
     <span class="status_'.strtolower($account['status_value']).'">'.ucfirst($account['status_value']).'</span> 
    FGH</p> 
</div> 

<div style="margin: 0px 74px 0px 74px; text-align: center; height: 66px; width:66px; background: url(\'img/'.strtolower($maintain).'hint.png\') no-repeat;"> 
    <span style="line-height: 66px; font-size: 36px; color: black;">'.$countdown.'</span> 
</div>'; 
?> 
<!-- SOME HTML --> 
<?php echo $hintMaintain; ?> 
2
<hr /> 
<div id="user_hint"> ABC DE 
<span class="status_strtolower(<? =$account['status_value']); ?>"> 
<? =ucfirst($account['status_value']);?> 
</span>FGH</div> 
<div style="margin: 0px 74px 0px 74px; text-align: center; height: 66px; width:66px; background: url('img/<?=strtolower($maintain);?>hint.png') no-repeat;"> 
    <span style="line-height: 66px; font-size: 36px; color: black;"><?=$countdown/></span> 
</div> 

<? =$something; ?> 

^^^将输出这个东西。