You are currently viewing PHP: Get the PHP extension name of a function by the function name

PHP: Get the PHP extension name of a function by the function name

  • Post category:PHP
  • Post comments:0 Comments
$function_name = 'imagecreate';

$class = new ReflectionFunction($function_name);
$extension = $class->getExtension();
echo $extension;