Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何回显html+;php中的php?_Php_Html - Fatal编程技术网

如何回显html+;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文件中有一段代码:

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