Re: trim last folder in a path



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.


.



Relevant Pages

  • Re: parting out 1949 OLDSMOBILE 88 Futuramic V-8
    ... People who part out old cars for trim parts should be shot in the back ... of the head. ... Prev by Date: ...
    (rec.audio.tubes)
  • IE ms-its: and mk:@MSITStore: vulnerability
    ... folder(1).htm:windows folder ... The following poc was given by Arman Nayyeri for the restriction bypass vulnerability, ... function getlink(){ ...
    (Bugtraq)
  • Re: [SBL 05/06] - Gut League Allegiance
    ... I certainly was when the word `pookie' popped into my head. ... it and I stopped making ghost images of mine when I stopped using ... into it with the understanding that I will cleanse the folder of chaff ...
    (uk.sport.football)
  • Re: Unknown User
    ... | user represented by an icon of a man's head with a red question mark to the ... | When I changed the name of a web folder, I found that the icon doesn't ... This showing of a SID is due to the inabilitiity to match the SID to a Domain account and ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Centering and Publishing Page
    ... Here are some alternative directions for using Replace in Files. ... index_files folder if you are using the subfolder option) to a folder on ... Each of your *.htm files requires ... added all of your info to the <head> line and saved the file ...
    (microsoft.public.publisher.webdesign)