You are here: Re: Help removing a simple space « PHP Programming Language « IT news, forums, messages
Re: Help removing a simple space

Posted by Steve on 09/20/05 18:54

> $sentence = str_replace(" .", ".", $sentence);
>
> but it does not work. I've tried other ways with no success.

> Why doesn't this work and how do I do this?

Maybe they are not spaces (ASCII 32). Could be some other white-space
characters, like TAB (ASCII 9) or FF (ASCII 12). Remember that viewing
text through a browser compresses runs of white-space down to a single
visual space. Look at the HTML source to be sure, ideally using a text
viewer or hex-editor that can highlight different kinds of white-space.

If that's the case look at regular expression functions eg
<http://www.php.net/preg_replace> for a solution.

---
Steve

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация