You are here: Re: basic string replacement « PHP Programming Language « IT news, forums, messages
Re: basic string replacement

Posted by Justin Koivisto on 07/11/05 19:19

Gonzillaaa wrote:

> If I have a string such as "/ Support us / Volunteering" how do I get
> rid of the first slash and not both of them? I had a go at ltrim but
> with no success. $path = ltrim($path, "/")
>
>
> Thanks,
>

$path=preg_replace('`/\s*`','',$path,1);

http://www.php.net/preg_replace

HTH

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com

 

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

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