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

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

  • Post category:PHP
  • Post comments:0 Comments
$class_name = 'DOMDocument';

$class = new ReflectionClass($class_name);
$extension = $class->getExtension();
echo $extension;