dirname() & basename()

From: Date: Wed, 16 Feb 2000 19:21:07 +0000
Subject: dirname() & basename()
Groups: php.version4 
Request: Send a blank email to php-version4+get-10368@lists.php.net to get a copy of this message
I have a quick question about the functionality of dirname() & basename(). For some reason, they both seem to ignore the trailing slash in directories. For example, dirname("/Moo/Cow/"); will return "/Moo" and basename("/Moo/Cow/"); will return "Cow". Is this the intended functionality of these functions? It would seem to me that it would make more sense for dirname("/Moo/Cow/"); to return "/Moo/Cow" and basename("/Moo/Cow/"); to return "". I've seen notes about this on the PHP website, but since this is the development version of PHP, I thought I'd post the query here to see what the actual developers have to say about this. Thanks, - Ben Schumacher

« previous php.version4 (#10368) next »