note 108018 added to function.function-exists

From: Date: Thu, 22 Mar 2012 14:51:50 +0000
Subject: note 108018 added to function.function-exists
Groups: php.notes 
Request: Send a blank email to php-notes+get-186774@lists.php.net to get a copy of this message
// If you want to chack if the function is enabled or disable in php.ini you can use this function: <?php function func_enabled($func) { $disabled = explode(',', ini_get('disable_functions')); foreach ($disabled as $disableFunction) { $is_disabled[] = trim($disableFunction); } if (in_array($func,$is_disabled)) { $it_is_disabled["m"] = $func.'() has been disabled for security reasons in php.ini'; $it_is_disabled["s"] = 0; } else { $it_is_disabled["m"] = $func.'() is allow to use'; $it_is_disabled["s"] = 1; } return $it_is_disabled; } ?> // An example of how to use: <?php $if_is_disabled = func_enabled('exec'); // return Arrey echo $if_is_disabled["m"]; // return text value echo '<br/>'; echo $if_is_disabled["s"]; // return 1 or 0 ?> ---- Server IP: 212.199.163.163 Probable Submitter: 81.218.172.200 ---- Manual Page -- http://www.php.net/manual/en/function.function-exists.php Edit -- https://master.php.net/note/edit/108018 Del: integrated -- https://master.php.net/note/delete/108018/integrated Del: useless -- https://master.php.net/note/delete/108018/useless Del: bad code -- https://master.php.net/note/delete/108018/bad+code Del: spam -- https://master.php.net/note/delete/108018/spam Del: non-english -- https://master.php.net/note/delete/108018/non-english Del: in docs -- https://master.php.net/note/delete/108018/in+docs Del: other reasons-- https://master.php.net/note/delete/108018 Reject -- https://master.php.net/note/reject/108018 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#186774) next »