![]() |
Removing double spaces with str_replace
I want to replace double spaces with single spaces.
I have been able to do this before : :
this worked or I thought it did anyway with other strings but I'm guessing there's something in the problem string that I'm not seeing anyway to get to the point this is what I have: :
the code above echoes the same before and after the str_replace command. What am I missing? it's definitely two spaces but as you can see I've even tried replacing a tab in case that's what it was... Are there any other characters it could be??? |
Re: Removing double spaces with str_replace
Are you positive that it's what comes from the database? Output it and then check the HTML (not what appears in the browser). This is because it could be using " " for a space, which appears to be a space in your browser, but is not the case in the data.
There could also be a newline, or something else. So make sure you're comparing it to the outputted HTML. |
Re: Removing double spaces with str_replace
Thanks. I'll try that when I get back to work on Monday.
|
| All times are GMT -5. The time now is 4:13 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC