/    Sign up×
Community /Pin to ProfileBookmark

how do i get a list of folders?

tried this :
Code:
glob(“imagesPDF*.*“,GLOB_ONLYDIR);

and i get nothing although i have folder thee!
why?

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@Da_WarriahJul 19.2004 — You could probably look into using [url=http://ca3.php.net/manual/en/function.opendir.php]opendir()[/url], [url=http://ca3.php.net/manual/en/function.readdir.php]readdir()[/url], and [url=http://ca3.php.net/manual/en/function.closedir.php]closedir()[/url] if you're looking to find each and every folder. You can then use something like [url=http://ca3.php.net/manual/en/function.is-dir.php]is_dir()[/url] to just get the directories rather than the files as well.
Copy linkTweet thisAlerts:
@ShrineDesignsJul 19.2004 — here is an example:[code=php]<?php
if(($handle = opendir(getcwd())))
{
while(($pointer = readdir($handle)) !== false)
{
if($pointer != '.' && $pointer != '..')
{
echo "$pointer<br />n";
}
}
closedir($handle);
}
?>
[/code]
Copy linkTweet thisAlerts:
@pyroJul 19.2004 — [i]Originally posted by ShrineDesigns [/i]

[B][code=php]while(($pointer = readdir($handle)))[/code][/B][/QUOTE]
Might want to take a look at the correct way of doing it at http://ca3.php.net/manual/en/function.readdir.php.
Copy linkTweet thisAlerts:
@ShrineDesignsJul 20.2004 — how often does someone name a file/dir "0" or "false" lol
Copy linkTweet thisAlerts:
@pelegk1authorJul 20.2004 — thnask alot every 1

second why when i use :opendir

i get this message :

that beacuse of security i cant use opendir
×

Success!

Help @pelegk1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...