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

Check Date/Time in PHP
What I need the code to check is that $reQuest is 24 hours in the past then return a time based on h

Help with PHP and checkboxes
I am posting this for a friend of mine, i wrote a small script for her to process her form data to a

Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL s

ldap connection
We are using ldap to get user information from the domain controller. It was working before. Recentl

Multi Level Array Problem
hi all,

For example I have array like below:

$temp = array(array('north america', 'us'

Get value from Select menu
Hi!

Have tried to find the solution on the web. Don't know if there is an easy one. A descrip

onclick problem
I have <input type="text" name="message">
<a href=page2.

Displaying pictures
i have worked my way through storing images in directory and storing the location in mySQL db.Now i

DB2 for z/OS, LUW, iSeries
Hello, In this forum a lot of threads related to other members of the DB2 family than DB2 for z/OS

Cache PHP Objects/Classes?
Does anyone have ideas about caching PHP objects using something like: http://memcached.org/

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