Home  >  Article  >  Backend Development  >  The html file and the php file have the same content, but the opening effect is different?

The html file and the php file have the same content, but the opening effect is different?

WBOY
WBOYOriginal
2016-10-18 08:41:541165browse
<code><html>
<head>
<meta charset="utf-8">
<title>展示学生资料</title>
</head>
<body>
<?php  $name="王六"; ?>
    <table>
        <tr>
            <td>姓名</td>
            <td><?php echo $name;?></td>
        </tr>
    </table>
</body>
</html>
</code>

The above program is saved as test.php and opened with a browser, and the displayed result is as follows
Name Wang Liu
When the above program is saved as test.html, opened with a browser, the displayed result is as follows
Name
The php in it is not parsed ?
Same content, different file types, why are there different results?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:sql multi-condition queryNext article:sql multi-condition query