Php Spacing

Reply

Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Php Spacing

 
0
  #1
Jun 17th, 2006
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:
  1. Testing 1 2 3

but when I extract the variable all I see is :
  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,082
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Php Spacing

 
0
  #2
Jun 18th, 2006
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.
[php]$str = str_replace(' ', ' ', $str);[/php]
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 147
Reputation: ashneet is an unknown quantity at this point 
Solved Threads: 1
ashneet's Avatar
ashneet ashneet is offline Offline
Junior Poster

Re: Php Spacing

 
0
  #3
Jun 18th, 2006
Thanks
That helps a lot..
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 494
Reputation: Puckdropper is an unknown quantity at this point 
Solved Threads: 21
Puckdropper Puckdropper is offline Offline
Posting Pro in Training

Re: Php Spacing

 
0
  #4
Jun 18th, 2006
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.
www.uncreativelabs.net

Old computers are getting to be a lost art. Here at Uncreative Labs, we still enjoy using the old computers. Sometimes we want to see how far a particular system can go, other times we use a stock system to remind ourselves of what we once had.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC