August 18th, 2013, 09:26 PM
PHP printing tabs in retrieved from the database.
I understand that nl2br returns string with '<br />' or '<br>' inserted before all newlines (\r\n, \n\r, \n and \r).
What can I do about tabs now?
How can I print tabs? In other words if I store plain text with some tabs, html removes them all. I need them back.
August 18th, 2013, 09:31 PM
Just like with newlines, HTML does not remove them. They're all condensed to a single whitespace.
Where are you displaying this and why do you need the actual tabs? Would a table be better?
August 18th, 2013, 09:55 PM
Originally Posted by requinix
I wanna preview like code.
I attached a screenshot of what it looks like in phpmy.
August 18th, 2013, 10:57 PM
Wouldn't that normally be done using <pre> tags?
August 18th, 2013, 11:19 PM
Originally Posted by Catacaustic