PHP hello world, strange problem

Asked

Viewed 46 times

0

I’m having a strange problem in a simple hello world with php, I use XAMPP in the latest version, and when declaring the most basic code:

<?php echo "Hello World" ?>

Instead of the result being one:

Hello World

Have:

Helloworld

And by applying a second space leaving the code this way:

<?php echo "Hello  World" ?>

The result becomes:

Hello World

That is, the expected initially.

I’m not sure if it’s a configuration fault or what it would be, I’m using the Edge browser, also in the latest stable version available.

  • 1

    If you look at the source code directly from the browser (right-click), the text remains together in the first case?

  • Yes, when analyzing the elements it is being printed in a <body>Helloworld</body>, but in the "console" tab it is leaving as expected, separate.

  • Can test in another browser?

  • I just downloaded google Chrome and performed the test and ran as expected... It would be an Edge bug then?

  • Maybe just the way he tries to render content that is not valid HTML (so much so that he added the tags <body> in the code, as you commented).

  • Try printing a full "hello world". With <html><head></head><body><h1>Hello, world!</h1></body></html>.

  • It’s probably this valid HTML issue anyway, I analyzed the EDGE debugger, and had the message about an error reading the HTML. Breno, I know there are other ways to make it work in the edge, but I was intrigued by the fact that this way is also correct not to work.

  • which php summer ?

  • 7.3.5 is the version used

  • tested in firefox or Chrome?

Show 5 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.