Jump to content

if dir exist command?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
phpforfun

phpforfun

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,236 posts
Hey guys, so I need the command that checks if a folder exists, not a file.. I could use if(file_exists(index.php)) and put an index in each file, but they might not have an index file in it...

I googled it and searched PHP.net. I hate posting bulletins for such little issues, but I need to solve this before tomorrow

#2
phpforfun

phpforfun

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,236 posts
oh man, I just found out you can use the file_exists for a folder too... Im sorry guys. Pointless thread.

Admins delete?

#3
Guest_Jaan_*

Guest_Jaan_*
  • Guests
you can use this also:

$dir = "images";
if(is_dir($dir)){
echo "It is a directory!";
}else{
echo "It is not a directory!";
}


#4
phpforfun

phpforfun

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,236 posts
Awesome, I guess I did learn something! Thanks!

#5
Guest_Jaan_*

Guest_Jaan_*
  • Guests
hehe.. that's great :)