今日の人気記事

  1. 配列を文字列に変換する - implode()
  2. 簡単なPHPスクリプトを動かしてみよう
  3. ファイルから1行ずつ読み込む - fgets()
  4. ユニークなファイル名の一時ファイルを作成 - tempnam()
  5. ヒアドキュメント

定義されている関数一覧を取得 - get_defined_functions()

当ページのリンクには広告が含まれています。

プログラミング言語PHPで、定義済みの関数一覧を連想配列で取得する関数 get_defined_functions()を紹介します。

get_defined_functions関数

array get_defined_functions ( void )
定義済みの関数一覧を連想配列で取得します。
返り値
定義済みの関数一覧の連想配列を返します。

サンプルコード

定義済みの関数一覧を配列として返すサンプルコードです。

get_defined_functions()
<?php
print_r( get_defined_functions() );
?>

実行結果です。連想配列が表示されています。やたらと長いので略しています。

Array
(
    [internal] => Array
        (
            [0] => zend_version
            [1] => func_num_args
            [2] => func_get_arg
            [3] => func_get_args
            [4] => strlen
            [5] => strcmp
            [6] => strncmp
            [7] => strcasecmp
            [8] => strncasecmp
            [9] => each
            [10] => error_reporting
            [11] => define
            [12] => defined
            [13] => get_class
            [14] => get_called_class
            [15] => get_parent_class
            [16] => method_exists
            [17] => property_exists
            [18] => class_exists
            [19] => interface_exists
            [20] => trait_exists
            [21] => function_exists
            [22] => class_alias
            [23] => get_included_files
            [24] => get_required_files
            [25] => is_subclass_of
            [26] => is_a
            [27] => get_class_vars
            [28] => get_object_vars
            [29] => get_class_methods

… 略 …

関数処理 の人気記事

まだデータがありません。

関連記事(一部広告含む)