Re: dirname bug
| From: | Marko Vukovic' | Date: | Mon, 18 Sep 2000 15:32:49 +0000 |
| Subject: | Re: dirname bug | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-17134@lists.php.net to get a copy of this message | ||
Maurizio Firmani wrote:
>
> Using PHP 4.0.1pl2
> I've found a strange behaviour of function dirname:
>
> $fileName = "/dir/";
> print "dirname:".dirname($fileName);
>
> gives:
> dirname:
>
> while if $fileName= "/dir/foo.bar" gives:
> dirname: /dir
>
> while if $fileName="/dir" produces nothing in the output, again:
> dirname:
>
> Strange, uh?
Not really, according to the manual:
"Given a string containing a path to a file, this function will return the name of the
directory."
Now, as I understand the above, the string ($filename) has to a path to an actual file/s, so
therefore $fileName = "/dir/*"; should do the trick.
--
Marko.