The first argument of fnmatch() is the pattern to match, but this variable is not defined inside the function, so this can be a problem, the same seems to happen with $parameters at line 7.
But a part that, what kind of error do you get?
Try to place some echoes or die() inside each level of the function to get the exact point where the error occours, or add error_reporting(-1); at the top of the script to get the output errors.
cereal
Veteran Poster
1,144 posts since Aug 2007
Reputation Points: 344
Solved Threads: 222
Skill Endorsements: 22