How to check weather a extension is loaded or not in your PHP

Aug 14, 2013, by admin

Here in the post we going to see How to check weather a extension is loaded or not in your PHP   

//gd represented GD Library as you usual say
    if (!extension_loaded(‘gd’)) {
    if (!dl(‘gd.so’)) {
    exit;
    }
    }

Returns boolean value true if the extension loaded and false otherwise .

Some other PHP extension related functions are

get_loaded_extensions()
Returns an array with the names of all modules compiled and loaded

get_extension_funcs()
Returns an array with the names of the functions of a module

dl()
Loads a PHP extension at runtime

Note: dl() is disables in some environment and it will also disabled in PHP Safe Mode.

Reference site : ScriptArticle.com