if (php_module_loaded('curl')) { // cURL functions can be used here } else { echo "cURL extension is not enabled"; }
if (php_module_loaded('gd')) { // GD functions can be used here } else { echo "GD extension is not enabled"; }This example checks if the GD extension is loaded and, if so, proceeds with using its functions. If not, it will display a message indicating that the extension is not enabled. Package library: The GD extension is part of the PHP core library, so no additional package or library is required to use it.