Welcome to WebmasterWorld Guest from 54.162.117.84

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Is a file a directory

     
2:30 pm on Oct 13, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:June 10, 2008
posts: 1130
votes: 0


I have a program that moves/renames files based on a search text inputted by the user. Is there a function that checks to see if a path is a directory and not a file. This is the logic I'm looking for

if(the path given is a file and not a folder){

do some code;

}
else{

do some code;

}
Thanks,

2:32 pm on Oct 13, 2008 (gmt 0)

Senior Member

joined:Jan 27, 2003
posts:2534
votes: 0


Don't forget the PHP manual, andrewsmd ;)

[php.net...]

8:19 pm on Oct 13, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:July 21, 2008
posts:103
votes: 0


think there's is_dir / is_file

agreed :) check the manual