Reputation: 63597
I am imploding an array. Instead of using a "," or other delimiter I would like two spaces.
How can this be accomplished?
I've tried:
<div>{implode(" ", $my_array)}</div> // Condenses to one space.
<div>{implode(" ", $my_array)}</div> // Just prints out the  . I do not use hashes in my code.
Note: I do NOT use the # in my nbsp. StackOverflow renders them as spaces if I don't :P
Upvotes: 0
Views: 1277
Reputation: 3534
Actually, your implode is working, but for HTML, multiple basic space will be rendered as a single space, its a fact.
That's why, there is the solution with "non-breakable space" also known as
.
You can also try to use some special tags like <pre>
in order to keep the initial format
Upvotes: 0
Reputation: 1156
try "\t"
(a horizontal tab) or just "   "
(two html spaces)
Upvotes: 1