略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Basic usage

2024-04-24

Basic usage

This example will open an RPM file and read the name, version, and release from the RPM file, echo the results, and close the RPM file.

Example #1 Basic RPMReader Example

<?php

$filename 
"/path/to/file.rpm";

// open file
$rpmr rpm_open($filename);

// get "Name" tag
$name rpm_get_tag($rpmrRPMREADER_NAME);

// get "Version" tag
$ver rpm_get_tag($rpmrRPMREADER_VERSION);

// get "Release" tag
$rel rpm_get_tag($rpmrRPMREADER_RELEASE);

echo 
"$name-$ver-$rel<br>\n";

// close file
rpm_close($rpmr);

?>
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/rpmreader.examples-basic.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3