$extensions = get_loaded_extensions(); if (in_array('curl', $extensions)) { // Curl extension is available // Do something with it... } else { // Curl extension is not available // Handle the situation... }
phpinfo();
$version = phpversion('mysql'); if ($version == '5.6.40') { // This version of MySQL is known to have a bug // Do something to handle it... } else { // This version of MySQL is ok // Proceed with normal operations... }In this example, we are checking the version of the MySQL package installed in PHP, and handling a bug that is known to exist in version 5.6.40.