Checking if a Directory exsists..

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Checking if a Directory exsists..

Post by Gen-ik »

..I need to check if a directory exsists, can anyone help?

Basically this is what I need to do..

CHECK IF DIRECTORY EXSISTS
IF YES DO THIS..
IF NO FO THIS INSTEAD..

Thanks.
fatalcure
Forum Contributor
Posts: 141
Joined: Thu Jul 04, 2002 12:57 pm
Contact:

Post by fatalcure »

Code: Select all

if (is_dir("myDirectory")) echo "It exists"; else echo "Nope, doesn't exist";
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

Ahhhh.. thanks. I knew it would be simple!
Post Reply