• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

PHP - Echo removes additional spaces

Hi,

I am giving a simple Echo command like this:

echo "Hello             Test"

But what gets displayed on the browser is

Hello Test

Basically its removing the extra white spaces in between the words 'Hello' & 'Test', is there something i can do to avoid this?

Thanks in advance

Cheers

Vasan
0
Vasan
Asked:
Vasan
1 Solution
 
ludofulopCommented:
you have to replace spaces with html entity   :
echo str_replace(' ', ' ', "Hello             Test");
0
 
InsoftserviceCommented:
hi,

You can try

echo "Hello       test";
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now