betterCode() PHP 2025

get_loaded_extensions

(PHP 4, PHP 5, PHP 7, PHP 8)

get_loaded_extensionsコンパイル/ロードされている全てのモジュールの名前を配列として返す

説明

get_loaded_extensions(bool $zend_extensions = false ): array

この関数は、PHPインタプリタにコンパイル、 ロードされている全てのモジュールの名前を返します。

パラメータ

zend_extensions

Zend 拡張モジュールのみを返します。指定しない場合は、 mysqli のような通常の拡張モジュールを返します。デフォルトは false (通常の拡張モジュールを返す) です。

戻り値

モジュール名の配列を返します。

例1 get_loaded_extensions() の例

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

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

Array
(
 [0] => Core
 [1] => date
 [2] => libxml
 [3] => pcre
 [4] => sqlite3
 [5] => zlib
 [6] => ctype
 [7] => dom
 [8] => fileinfo
 [9] => filter
 [10] => hash
 [11] => json
 [12] => mbstring
 [13] => SPL
 [14] => PDO
 [15] => session
 [16] => posix
 [17] => Reflection
 [18] => standard
 [19] => SimpleXML
 [20] => pdo_sqlite
 [21] => Phar
 [22] => tokenizer
 [23] => xml
 [24] => xmlreader
 [25] => xmlwriter
 [26] => gmp
 [27] => iconv
 [28] => intl
 [29] => bcmath
 [30] => sodium
 [31] => Zend OPcache
)

参考

  • get_extension_funcs() - あるモジュールの関数名を配列として返す
  • extension_loaded() - ある拡張モジュールがロードされているかどうかを調べる
  • dl() - 実行時に PHP 拡張モジュールをロードする
  • phpinfo() - PHP の設定情報を出力する

Found A Problem?

Learn How To Improve This PageSubmit a Pull RequestReport a Bug
+add a note

User Contributed Notes

There are no user contributed notes for this page.

AltStyle によって変換されたページ (->オリジナル) /