(PECL rpminfo >= 0.1.0)
rpminfo — Get information from a RPM file
$path
   [, bool $full = FALSE
   [, string &$error
  ]] ) : arrayRetrieve information about a local file, a RPM package.
pathPath of the RPM file.
full
      If TRUE all information headers for the file are retrieved, else only a minimal set.
     
errorIf provided, will receive the possible error message, and will avoid a runtime warning.
An array of information or NULL on error.
Example #1 A rpminfo() example
<?php
$info = rpminfo("./php-pecl-rpminfo-0.4.2-1.el8.remi.7.4.x86_64.rpm");
print_r($info);
?>
The above example will output:
Array
(
    [Name] => php-pecl-rpminfo
    [Version] => 0.4.2
    [Release] => 1.el8
    [Summary] => RPM information
    [Arch] => x86_64
)