首页 > 解决方案 > 如何让度数符号显示在我的表中

问题描述

我必须为我的 F 和 C 在我的表中添加一个度数符号,我首先尝试做 $Celsius$deg 但是当我使用这个函数时,我的页面上出现语法错误,我是 php 新手,我从未合并以前在我的表中的度数符号,任何帮助将不胜感激。

(我会注意到我已经有了代码和表格,但是,我只是想让符号显示在我的表格中)

    <table align="center" border="1" width="30%">



    <thead>
        <td>Celsius</td>
        <td>Fahrenheit</td>
    </thead>

    <?php
    $celsius = 100;
    
    while ($celsius >= -40) {
    $fahrenheit = ($celsius * 9.0/5.0) + 32;
        
        print "<tr><td>$celsius</td><td>$fahrenheit</td></tr>";
    
    
    $celsius -= 10;
        $fahrenheit -= 10;
    
    }

?>

</table>

标签: php

解决方案


推荐阅读