As mentioned in PHP Manual
pattern
The pattern. No tilde expansion or parameter substitution is done.
I tried to find files with path name in a variable and it didn’t work.
The loader file (main function in the program) needs to include few files which reside in the same directory of the present class file that the loader file is working on . So , I tried below work around in the loader file.
$cwd = getcwd();
$reflector = new ReflectionClass($class_name); //$class_name come from $_GET
$fname = $reflector->getFileName();
$fdir = dirname($fname);
chdir ($fdir);
$include_file_name = glob("*.inc");
chdir ($cwd);
It works but just wants to know is it a good work around or is there anything else I can do.