is_dir() problem


Posted on 16th Feb 2014 07:03 pm by admin

Hello,

I'm buidling a php scripts that dynamically get's subfolders from a specific folder.
my code:
Did you know?Explore Trending and Topic pages for more stories like this.

Code: <?php

if(isset($button)){

$opendirdepot = opendir("C:/xampp/htdocs/arl/$depot/");


while($dirdepot = readdir($opendirdepot)){

if(is_dir($dirdepot)){

echo "Is a folder: ".$dirdepot."<br />";

}else{

echo "Is not a folder: ".$dirdepot."<br />";

}

}

closedir($opendirdepot);

}

?>
Output:

QuoteIs a folder: .
Is a folder: ..
Is not a folder: 20091012
Is not a folder: 20091013
Is not a folder: Error_.log
Is not a folder: Error_20091013.log
The problem is that 20091012 and 20091013 are in fact folders.

Anyone an idea?

Thanks
No comments posted yet

Your Answer:

Login to answer
226 Like 31 Dislike
Previous forums Next forums
Other forums

Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa

Baffled by Undefined Index in Simple Array: Please Help!
Hello. I have a form which posts an array to this script. However, I can't seem to access the values

I apologise! It's a newbie to PHP feedback form problem!
Hi,

I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% r

Time script, set to my time zone?
I am using this line to get the date and time

Code: $time = date(F." ".d.", &q

Random Number Generation And Probability
Hello, I am working on a function which has to insert data into a SQL table.

we have to suppl

Setting condidtions for an input box
Hi all,

I would like to set a condition in a txt box that says the number a user enters has t

Warning: session_start() [function.session-start]: Cann.....
hi, can someone help me with this? I keep getting this error....

Warning: session_start() [fu

Php Mysql Page Loading Notice
Hi all,

I was wondering if there is a way (Sure there is) of showing a message or an image wh

Converting from one format to another
"I have got a date in DD/MM/YYYY but I need it in MM-DD-YYYY. Help!"

Mail functionality from localhost to server
Hi

I am facing problem of mail functionality.

When i tested mail functionality in my

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash