Jump to content

How do you get php to output more than one space?


arthaeus

Recommended Posts

I can write a string to the screen, but if i want to put tabs between them, php will print ONLY ONE space instead of the tab. if i replace the '\t' with 50 spaces, the screen will only output one. im trying to create a tree like structure like the following

 

 

element one

*<tab>* response to element one

element two

*<tab>* response to element two

 

 

each of the tabs is reduced to one character. can anyone help??

Link to comment
Share on other sites

\t and \n will only display in the source code. Anything more than one spacebar stroke will render in the browser as one space. Perfect example is typing on multiple lines. When HTML the renders, it reads prefectly normal, one word after another.

 

If you want multiple spaces, use a < pre > tag or  

 

Google both of them.

 

Example:

<pre>                                            i hit spacebar 50 times before this.</pre>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.