如何回显html+;php中的php?
我的php文件中有一段代码:如何回显html+;php中的php?,php,html,Php,Html,我的php文件中有一段代码: <?php echo (is_int(($index-1)/$rpp) && $index != 1) ? "</tbody></table></li><li><table class='rc-list-table' width='100%'><tbody><tr>" : "<tr>" ; ?&g
<?php
echo (is_int(($index-1)/$rpp) && $index != 1) ?
"</tbody></table></li><li><table class='rc-list-table' width='100%'><tbody><tr>" :
"<tr>" ;
?>
冒号语法
使您的代码更加清晰
<thead>
<tr>
<th><?php _e('Q.No', 'r-check'); ?></th>
<?php for ($i=0; $i < $dim ; $i++): ?>
<th><?php echo chr($i+65); ?></th>
<?php endfor; ?>
</tr>
</thead>
这就是我理解你的问题。下面呢
<?
if(is_int(($index-1)/$rpp) && $index != 1):
?>
</tbody></table></li><li><table class='rc-list-table' width='100%'>
<thead>
<tr>
<th><?php _e('Q.No', 'r-check'); ?></th>
<?php
for ($i=0; $i < $dim ; $i++) : ?>
<th><?php echo chr($i+65); ?></th>
<?php endfor; ?>
</tr>
</thead>
<tbody><tr><tr>
<? endif;?>
我认为您对“?>”有问题是对的吗?如果您有问题,请将其更改为“?”。“>”,好的。这就足够了。但是,是否不可能将echo输出为上述格式?
<thead>
<tr>
<th><?php _e('Q.No', 'r-check'); ?></th>
<?php for ($i=0; $i < $dim ; $i++): ?>
<th><?php echo chr($i+65); ?></th>
<?php endfor; ?>
</tr>
</thead>
<?
if(is_int(($index-1)/$rpp) && $index != 1):
?>
</tbody></table></li><li><table class='rc-list-table' width='100%'>
<thead>
<tr>
<th><?php _e('Q.No', 'r-check'); ?></th>
<?php
for ($i=0; $i < $dim ; $i++) : ?>
<th><?php echo chr($i+65); ?></th>
<?php endfor; ?>
</tr>
</thead>
<tbody><tr><tr>
<? endif;?>