0

I think is problem may be more connected to HTML rather then php.

The issue I have is that I have a my sql db and in one of the colume in which there is a string like:

Testing    1    2   3

but when I extract the variable all I see is :

Testing 1 2 3

I also tried to use the "htmlspecialchars" command but it wont do anything so if you have any suggestions how the problem may be fixed please post.

3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by Puckdropper
0

Have you tested to see if htmlspecialchars() converts spaces to   ?

If it doesn't you can try htmlentities()

It may also be faster to just use a string replace.

$str = str_replace(' ', ' ', $str);
0

No problem, it's supposed to work like that ;-)

HTML for whatever reason condenses multiple spaces into one. To get it to keep its spacing (for an ASCII drawing or whatnot) use the < PRE > and < /PRE > tags (no spaces.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.