Re: trim last folder in a path
- From: "Simon Bridgewater" <simon@xxxxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 21:27:28 GMT
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@xxxxxxx> wrote in message
news:ObednUVRDqAg9l3fRVn-gQ@xxxxxxxxxxxxxxxx
> 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.
.
- Follow-Ups:
- Re: trim last folder in a path
- From: paul
- Re: trim last folder in a path
- References:
- trim last folder in a path
- From: paul
- trim last folder in a path
- Prev by Date: trim last folder in a path
- Next by Date: Re: help with framing a pic
- Previous by thread: trim last folder in a path
- Next by thread: Re: trim last folder in a path
- Index(es):
Relevant Pages
|