Posted by Andrι Hδnsel on 12/17/48 11:52
Chung Leong schrieb:
> AndrΓ© HΓ€nsel wrote:
> > is there a function like is_subdir in PHP?
>
> If you mean a function that tells you whether a directory is a
> sub-directory in another, that answer is no. You can approximate it
> from getting the absolute path of both with realpath() and then compare
> them.
Unfortunately this doesn't work. When I have such a structure...
/
|-- collection
| `-- dir -> /dir
`-- dir
`-- subdir
....then /collection/dir/subdir is a subdir of /collection but the
realpath solution says no, because it dereferences the symlinks.
Regards,
AndrΓ©
Navigation:
[Reply to this message]
|