joquius Posted December 13, 2006 Share Posted December 13, 2006 I'm not too familiar with glob() but for some reason, when I do the following:for example, a directory has a file named "file12.txt"glob ("/dir/file*"); my result is nullhowever withglob ("/dir/file1*"); my result is the fileI can't figure out why this is happening, but I thought I'd ask before defecting to readdir() Quote Link to comment Share on other sites More sharing options...
Caesar Posted December 13, 2006 Share Posted December 13, 2006 What ya trying to do? I use glob() in a few of my scripts....maybe I can give you some example code if it's pertinent. Quote Link to comment Share on other sites More sharing options...
joquius Posted December 13, 2006 Author Share Posted December 13, 2006 I'm merely using glob as a replacement for readdir Quote Link to comment Share on other sites More sharing options...
Caesar Posted December 13, 2006 Share Posted December 13, 2006 [quote author=joquius link=topic=118505.msg484265#msg484265 date=1166040647]glob ("/dir/file*");[/quote]Hmmmm...that looks right. And it should work, provided you file names are "filexx.mp3" or such.Edit....wait, try this:[code]<?php$dir = "dir/";glob ($dir."file*");?>[/code]Where is the file relative to where you're calling it from? Quote Link to comment Share on other sites More sharing options...
joquius Posted December 13, 2006 Author Share Posted December 13, 2006 Well I gave the function the full path from the base dir accessible on the server. What's strange is that I have to give quite a specific spectrum for it to return anything at all. I wonder if it's to do with the number of files. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.