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() Link to comment https://forums.phpfreaks.com/topic/30542-glob-issue/ 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. Link to comment https://forums.phpfreaks.com/topic/30542-glob-issue/#findComment-140614 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 Link to comment https://forums.phpfreaks.com/topic/30542-glob-issue/#findComment-140622 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? Link to comment https://forums.phpfreaks.com/topic/30542-glob-issue/#findComment-140624 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. Link to comment https://forums.phpfreaks.com/topic/30542-glob-issue/#findComment-140628 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.