Welcome to WebmasterWorld Guest from

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 10+ 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;


do some code;


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

Senior Member

joined:Jan 27, 2003
votes: 0

Don't forget the PHP manual, andrewsmd ;)


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

Junior Member

10+ Year Member

joined:July 21, 2008
votes: 0

think there's is_dir / is_file

agreed :) check the manual