Hello,
I have an array consisting of some elements, Some elements are being seperated with 3 spaces in between like 'new folder'(3 spaces are there in between). When I display the array elements on the screen, it displays me correctly. But when I display the same thing on the browser, it displays only one space instead of three. Can any one please post a solution for this? What do I need to do in order to display the spaces as it is?
Thanks and regards,
Mohan
php code
Moderator: General Moderators
-
Mark Baker
- Forum Regular
- Posts: 710
- Joined: Thu Oct 30, 2008 6:24 pm
Re: php code
This isn't a PHP problem, it's the way browsers work: they always compress multiple "white space" characters down to a single space.
You can, however, wrap your output in <pre> tags, which will retain the spaces
You can, however, wrap your output in <pre> tags, which will retain the spaces
Code: Select all
<pre>This is a set of spaces</pre>