The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 807 - File: showthread.php PHP 7.3.15 (Linux)
File Line Function
/showthread.php 807 errorHandler->error





Post Reply 
 
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Whitespace in strings
2016-07-29, 22:17
Post: #1
Whitespace in strings
How does one go about printing whitespace characters with echo? I'm attempting to center some text and since there is no option to do so with echo (possible feature enhancement?), I figured I'd try some equivalent methods. Escape sequences don't seem to work: [2J successfully clears the screen, but [12C seems to be interpreted (single blank space in output) and then ignored (no movement to the right). 'echo' with blank spaces and then the string only prints the string. 'echo' with quotes around blank spaces and string appears to print the quote, a space, and then the string, with all other leading spaces stripped. I suppose I could do 12x 'echo -n', but is there an easier/better way of doing this?
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Whitespace in strings - weaver6999 - 2016-07-29 22:17
RE: Whitespace in strings - NiKiZe - 2016-08-02, 20:31



User(s) browsing this thread: 1 Guest(s)