user6011904
user6011904

Reputation:

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

The <br> and <hr> tags don't work in PhpStorm and when I'm running my index.php file in PhpStorm whit this code :

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

I'm getting this in console:

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

Why is this happening?

Upvotes: 0

Views: 634

Answers (1)

jszobody
jszobody

Reputation: 28901

The PHPStorm console is show you your exact output. And It's accurate.

The <hr> and <br> tags are HTML. In the console you'll see them just like this.

When you load your page in a web browser those HTML tags will display as a horizontal rule and a blank line, as you expect.

See here for more info about the different options PHPStorm provides for running your PHP code:

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

Upvotes: 4

Related Questions