Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<rpmdefinerpmexpandnumeric>
^RpmInfo FunctionsLast updated: Mon, 26 Oct 2026

rpmexpand

(PECL rpminfo >= 1.2.0)

rpmexpand — Retrieve expanded value of a RPM macro

Description

function 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 expansions.

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


<rpmdefinerpmexpandnumeric>
^RpmInfo FunctionsLast updated: Mon, 26 Oct 2026