arthaeus Posted July 6, 2007 Share Posted July 6, 2007 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 https://forums.phpfreaks.com/topic/58762-how-do-you-get-php-to-output-more-than-one-space/ Share on other sites More sharing options...
GingerRobot Posted July 6, 2007 Share Posted July 6, 2007 Output &nsbp; for each space you would like to have: <?php echo 'test test'; ?> Gives: test test Link to comment https://forums.phpfreaks.com/topic/58762-how-do-you-get-php-to-output-more-than-one-space/#findComment-291511 Share on other sites More sharing options...
soycharliente Posted July 6, 2007 Share Posted July 6, 2007 \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 https://forums.phpfreaks.com/topic/58762-how-do-you-get-php-to-output-more-than-one-space/#findComment-291512 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.