(PECL rpminfo >= 1.2.0)
rpmexpand — Retrieve expanded value of a RPM macro
text
Text with RPM macros to expand.
A string with concatenated macro expansion(s).
Example #1 A rpmexpand() example
<?php
$distro = rpmexpand("%{?fedora:Fedora %{fedora}}%{?rhel:Enterprise Linux %{rhel}}");
print_r($distro);
?>
The above example will output:
Fedora 41