ConFoo 2025

snmp_set_quick_print

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

snmp_set_quick_printSet the value of enable within the NET-SNMP library

Açıklama

snmp_set_quick_print(bool $enable): true

Sets the value of enable within the NET-SNMP library. When this is set (1), the SNMP library will return 'quick printed' values. This means that just the value will be printed. When enable is not enabled (default) the NET-SNMP library prints extra information including the type of the value (i.e. IpAddress or OID). Additionally, if quick_print is not enabled, the library prints additional hex values for all strings of three characters or less.

By default the NET-SNMP library returns verbose values, quick_print is used to return only the value.

Currently strings are still returned with extra quotes, this will be corrected in a later release.

Bağımsız Değişkenler

enable

Dönen Değerler

Daima true döndürür.

Sürüm Bilgisi

Sürüm: Açıklama
8.2.0 Dönüş türü artık true;evvelce, bool idi.

Örnekler

Setting quick_print is often used when using the information returned rather than displaying it.

Örnek 1 Using snmp_set_quick_print()

<?php
snmp_set_quick_print
(0);
$a = snmpget("127.0.0.1", "public", ".1.3.6.1.2.1.2.2.1.9.1");
echo
"$a\n";
snmp_set_quick_print(1);
$a = snmpget("127.0.0.1", "public", ".1.3.6.1.2.1.2.2.1.9.1");
echo
"$a\n";
?>

Yukarıdaki örnek şuna benzer bir çıktı üretir:

'Timeticks: (0) 0:00:00.00'
'0:00:00.00'

Ayrıca Bakınız

add a note

User Contributed Notes

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