PHP 8.5.0 Alpha 1 available for testing

Voting

: three plus two?
(Example: nine)

The Note You're Voting On

admin at gk-root dot com
13 years ago
// 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
?>

<< Back to user notes page

To Top