猿问

如何将下列代码的html和PHP分离写到两个文件中

    <?php
                if(!empty($data)){
                    foreach($data as $value){
                        ?>
                        <tr>
                            <td bgcolor="#FFFFFF" >&nbsp;<?php echo $value['id']?></td>
                            <td bgcolor="#FFFFFF" style="color: red">&nbsp;<?php echo $value['author']?></td>
                            <td  bgcolor="#FFFFFF" style="text-indent:1.5em;word-wrap:break-word; word-break:break-all;">&nbsp;<?php echo $value['content']?></td>
                            <td bgcolor="#FFFFFF" style="text-align:center">&nbsp;<?php echo $value['dateline']?></td>
                            <td  bgcolor="#FFFFFF" style="text-indent:1.5em; color: blue">&nbsp;<?php echo $value['reply']?></td>

                        </tr>
                    <?php
                    }
                }
                ?>
            </table></td>
    </tr>

</table>
</body>
</html>


孤独QWER
浏览 1236回答 1
1回答
随时随地看视频慕课网APP
我要回答