rpmexpand
PHP function
Edit on GitHub ✎
(PECL rpminfo >= 1.2.0)
Retrieve expanded value of a RPM macro
Description
rpmexpand(string $text): string
Retrieve expanded value of a RPM macro.
Parameters
textText with RPM macros to expand.
Return Values
A string with concatenated macro expansions.
Examples
A rpmexpand() example
php
<?php
$distro = rpmexpand("%{?fedora:Fedora %{fedora}}%{?rhel:Enterprise Linux %{rhel}}");
print_r($distro);
?>The above example will output:
output
Fedora 41