PHP 8.4.2 Released!

rpmexpand

(PECL rpminfo >= 1.2.0)

rpmexpandRetrieve expanded value of a RPM macro

Description

rpmexpand(string $text): string

Retrieve expanded value of a RPM macro.

Parameters

text

Text with RPM macros to expand.

Return Values

A string with concatenated macro expansion(s).

Examples

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

See Also

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top