Reply to Re: trim last folder in a path

Your name:

Reply:


Posted by paul on 06/28/05 00:44

Cool, thanks that worked!


Simon Bridgewater wrote:

> There may be a simpler way but off the top of my head it should work..
>
> $curdir = 'c:/www/trit/plants';
> $dir_arr = explode('/',$curdir);
> $last_folder = $dir_arr[sizeof($dir_arr)-1];
> echo $last_folder;
>
> "paul" <paul@not.net> wrote in message
> news:ObednUVRDqAg9l3fRVn-gQ@speakeasy.net...
>
>>How do I trim last folder in a path.
>>
>>$curdir = "c:/www/triteleia/plants"
>>I just want "plants"
>>
>>Sorry, I always struggle with strings & can't even begin to figure this
>>one out.
>
>
>

[Back to original 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

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