September 2001
Intermediate to advanced
768 pages
32h 45m
English
bool extension_loaded(string name) Checks for an extension.
Returns:
TRUE if extension is loaded; FALSE on error
Description:
Checks whether an extension is loaded into PHP. This can be useful in more complex scripts in which functionality depends on an extension being present. For example, a graphing class can check for the existence of the GD library before any other action is taken and produce a friendly error if no GD support is available, or try to load the extension itself.
Version:
Existing since version 3.0.10
Example:
if (extension_loaded("gd")) {
echo "Extension found";
} else {
echo "Extension not found. Attempting load";
dl("php_gd.dll");
}
|
Read now
Unlock full access