Thanks for looking at my thread,
Using PHP, I want to check if a object in a directory is a file or folder like:
filetype();
Above function works, however I think filetype needs to be installed optionally?
Regards, Jason
Why not just loop the directory and use [man]is_file[/man] and [man]is_dir[/man]?
Thanks,
The odd thing is, is_dir returns true on files as well.
I have no idea why though.
TitanKing wrote:I think filetype needs to be installed optionally?
I think filetype needs to be installed optionally?
According to the manual, it is part of the standard installation as of PHP4. It doesn't support URL wrappers until PHP5 though.
http://us2.php.net/filetype
Well, thank you very much Kudo, you are such a helpful person!
TitanKing wrote:you are such a helpful person!
you are such a helpful person!
Thanks.
This might help you http://us2.php.net/manual/en/function.is-dir.php#72427
If not, check out some of the other problems in the comments and see if you can find a resolution. Otherwise, I'd wait for Weedpacket, Brad, Laserlight or one of the other really smart people to read this thread.
Ouch my bad,
is_dir, is_file
does work, you just need to provide true directory (/var/www/this_dir).
Thanks again, 🙂
TitanKing wrote:you just need to provide true directory (/var/www/this_dir).
you just need to provide true directory (/var/www/this_dir).
cough Absolute path. cough
😉
LOL ! Yea...