PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

get_defined_functions - 定義済みの全ての関数を配列で返す | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

get_defined_functions

(PHP 4 >= 4.0.4, PHP 5, PHP 7)

get_defined_functions定義済みの全ての関数を配列で返す

説明

array get_defined_functions ([ bool $exclude_disabled = FALSE ] )

すべての定義済み関数を配列で返します。

パラメータ

exclude_disabled

Whether disabled functions should be excluded from the return value.

返り値

この関数は、組込 (内部) 関数およびユーザー定義関数を共に含む定義済み の全ての関数のリストを有する多次元配列を返します。内部関数は、 $arr["internal"]、ユーザー定義関数は $arr["user"] によりアクセス可能となります (以下の例を参照ください)。

変更履歴

バージョン 説明
PHP 7.0.15, PHP 7.1.1 exclude_disabled パラメータが追加されました。

例1 get_defined_functions() の例

<?php
function myrow($id$data)
{
    return 
"<tr><th>$id</th><td>$data</td></tr>\n";
}

$arr get_defined_functions();

print_r($arr);
?>

上の例の出力は、 たとえば以下のようになります。

Array
(
    [internal] => Array
        (
            [0] => zend_version
            [1] => func_num_args
            [2] => func_get_arg
            [3] => func_get_args
            [4] => strlen
            [5] => strcmp
            [6] => strncmp
            ...
            [750] => bcscale
            [751] => bccomp
        )

    [user] => Array
        (
            [0] => myrow
        )

)

参考


忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「get_defined_functions - 定義済みの全ての関数を配列で返す」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | get_defined_functions - 定義済みの全ての関数を配列で返す」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: