Jump to content

glob() issue


joquius

Recommended Posts

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 null
however with
glob ("/dir/file1*"); my result is the file

I 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

[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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.