为什么 <br> 和 <hr> 标签在 PhpStorm 中不起作用

Why <br> and <hr> tag don't work in PhpStorm

<br><hr> 标签在 PhpStorm 中不起作用,当我 运行 我在 PhpStorm 中的 index.php 文件时,代码如下:

<?php
$a=10;
echo "This is $a";
echo "\n";
echo 'This is $a';
echo "\n";
echo "<hr>";
echo "<br>";
print "This is $a";
?>

我在控制台中得到这个:

This is 10
This is $a
<hr><br>This is 10

为什么会这样?

PHPStorm 控制台向您显示精确 输出。而且准确无误。

<hr><br> 标签是 HTML。在控制台中,您会像这样看到它们。

当您在网络浏览器中加载您的页面时,这些 HTML 标记将如您所料显示为一条水平线和一个空行。

有关不同选项的更多信息,请参阅此处 PHPStorm 提供 运行 您的 PHP 代码:

https://www.jetbrains.com/phpstorm/help/running-php-applications.html