You are here: Re: How do I replace a '_' with a space ? « PHP Programming Language « IT news, forums, messages
Re: How do I replace a '_' with a space ?

Posted by Brandon Rohde on 12/02/01 11:29

$my_string = "United_Kingdom";
$my_new_string = str_replace("_", " ", $my_string);
echo "$my_new_string"; //this will output United Kingdom

When you use str_replace(), you need to give it 3 elements. The first is the
character you want to replace, the second is the character to replace it
with, and the third is the string you want to modify.

You can find more info on it at www.php.net/str_replace
--
-Brandon Rohde



"VS" <vs@nospam.blueyonder.invalid> wrote in message
news:b%q4f.35616$U9.15574@fe3.news.blueyonder.co.uk...
> Hi,
>
> I'm new to PHP, I'm having trouble finding a way to replace a '_' in a
> string with a space.
>
> i.e using 'eregi_replace' I want to change
>
> 'United_Kingdom' to
>
> 'United Kingdom'
>
> --
> VS

 

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

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