Hi,
I am not sure if the syntax is the problem. I have two folder named 'moodle' and 'phptest' inside folder 'C:\Inetpub\wwwroot'. I have a test program named 'test.php' inside 'phptest' folder which contains below code:
<?php
foreach (glob("../moodle/*",GLOB_NOCHECK ) as $filename)
{
echo $filename.'<br>';
}
?>
On running this code I get a perfectly valid output, I am pasting below bit of it as it is huge.
../moodle/CHANGES
../moodle/COPYING.txt
../moodle/README.txt
../moodle/admin
../moodle/auth
../moodle/backup
../moodle/blocks
../moodle/blog
../moodle/calendar
../moodle/config-dist.php
../moodle/config.php
../moodle/course
../moodle/enrol
../moodle/error
../moodle/file.php
../moodle/files
../moodle/filter
../moodle/grade
../moodle/group
../moodle/help.php
I am using IIS7.0+PHP5.2.11.
I also put up an invalid directory by changing code to:
<?php
foreach (glob("../moodle1232/*",GLOB_NOCHECK ) as $filename)
{
echo $filename."<br>";
}
?>
I still get the output in the browser as:
../moodle1232/*
because of GLOB_NOCHECK flag.
A smaller code to reproduce the problem will be very much helpful. Please try storing the output of glob function in an array and try printing it using print_r or something similar and see if there are any problems.
Thanks,
Don.