AFAIK globcan only be disabled using the disable_functionsini parameter . Use function_exists()to determine if it is available:
if(function_exists('glob')) {
glob('...');
}
You can try this using these simple tests:
you@server ~ $ php -ddisable_functions='glob' -r 'var_dump(function_exists("glob"));'
bool(false)
you@server ~ $ php -r 'var_dump(function_exists("glob"));'
bool(true)
source
share