trim last folder in a path



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.
.