PHP 8.3.0 RC 6 available for testing

snmp_get_quick_print

(PHP 4, PHP 5, PHP 7, PHP 8)

snmp_get_quick_print 获取当前 NET-SNMP 库的 quick_print 设置的值

说明

snmp_get_quick_print(): bool

返回当前 NET-SNMP 库中存储的 quick_print 值。 quick_print 默认为 off。

参数

此函数没有参数。

返回值

如果 quick_print 为 on,返回 true 否则为 false

示例

示例 #1 snmp_get_quick_print() 示例

<?php
$quickprint
= snmp_get_quick_print();
?>

参见

add a note

User Contributed Notes 1 note

up
-9
antic
20 years ago
This can be used to parse the returned values depending on the quick print setting. For example sysUpTime might look something like this: "Timeticks: (34575334) 4 days, 0:02:33.34", but if quick print is enabled it will be on the form: "4:0:2:33.34". To get the same output you can parse it differently, something like:

if(@ $sysUpTime = snmpget($switch,$community,"system.sysUpTime.0")){
if(snmp_get_quick_print()){
sscanf($sysUpTime, "%d:%d:%d:%d.%d",$day,$hour,$minute,$sec,$ticks);
$sysUpTime = "$day days, $hour:$minute:$sec.$ticks";
}else{
$sysUpTime = ereg_replace("Timeticks: \([0-9]+\) ","",$sysUpTime);
}
}
To Top