PHP Check if Safe Mode is On
Quick snippet to check if PHPs “safe mode” is enabled on the current machine. This technique uses the ini_get()
function checking the safe_mode
option. Simple and self-explanatory:
if (ini_get('safe_mode')) {
echo 'ON';
} else {
echo 'OFF';
}
Learn more about ini_get() at PHP.net.