extension_loaded 


php128 apg

FIND out whether an extension is loaded.

This tutorial covers the mathematical functions contained in the extensions:

standard

bcmath

and

gmp



<?php

bool extension_loaded 
string $extension )


where,

$extension The name of the extension
  
?>

  $extension   


The extension name.

This parameter is case-insensitive.



  1 EXERCISE   

<?php

// The result of this exercise will depend
// of the configuration of your system

$arrext01 = [ =>'standard'=> 'bcmath'=> 'gmp' ];

for(
$i01 1$i01 <= 3$i01++)
{
if(
extension_loaded($arrext01[$i01]))
{
    echo 
'The extension "' $arrext01[$i01] . '" is loaded!<br><br>';
}
else
{
    echo 
'The extension "' $arrext01[$i01] . '" is NOT loaded!<br><br>';
}
}
?>

 RESULT   

The extension "standard" is loaded!

The extension "bcmath" is loaded!

The extension "gmp" is loaded!