glob() order of list?

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
arbitter
Forum Newbie
Posts: 24
Joined: Tue Dec 29, 2009 10:04 am

glob() order of list?

Post by arbitter »

I get this warning when I try the glob_onlydir() :

Fatal error: Call to undefined function glob_onlydir() in

but when I use glob(), it does work.
I have XAMPP, php 5.3.0, so I don't understand why it doesn't work...

Are there other alternatives so I only get the directories, using glob()?

I've found a way to fix this. I just used glob("*'10"), seen all the directories end with '10. Now the only problem is, can you sort something with glob()? So the files wich were added the most recently go to the bottom?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: glob() order of list?

Post by pickle »

Where did you see glob_onlydir() defined as a function? It's supposed to be GLOB_ONLYDIR - as in a global that can be passed as an argument to glob(). The docs should tell you what you need.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
arbitter
Forum Newbie
Posts: 24
Joined: Tue Dec 29, 2009 10:04 am

Re: glob() order of list?

Post by arbitter »

Well, I found it on a couple of sites... but now that you mention it, if I search fr how you say glob_onlydir is, it is indeed as you say so. My bad.
Post Reply