array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.snmp-set-enum-print.php', 1 => 'snmp_set_enum_print', 2 => 'Return all values that are enums with their enum value instead of the raw integer', ), 'up' => array ( 0 => 'ref.snmp.php', 1 => 'SNMP Функції', ), 'prev' => array ( 0 => 'function.snmp-read-mib.php', 1 => 'snmp_read_mib', ), 'next' => array ( 0 => 'function.snmp-set-oid-numeric-print.php', 1 => 'snmp_set_oid_numeric_print', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/snmp/functions/snmp-set-enum-print.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

snmp_set_enum_print

(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)

snmp_set_enum_print Return all values that are enums with their enum value instead of the raw integer

Опис

function snmp_set_enum_print(bool $enable): true

This function toggles if snmpwalk/snmpget etc. should automatically lookup enum values in the MIB and return them together with their human readable string.

Параметри

enable
As the value is interpreted as boolean by the Net-SNMP library, it can only be "0" or "1".

Значення, що повертаються

Завжди повертає true.

Журнал змін

Версія Опис
8.2.0 Тепер повертається значення типу true. До цього був bool.

Приклади

Приклад #1 Using snmp_set_enum_print()

<?php
 snmp_set_enum_print(0);
 echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') . "\n";
 snmp_set_enum_print(1);
 echo snmpget('localhost', 'public', 'IF-MIB::ifOperStatus.3') . "\n";
?>

The above would return

INTEGER: up(1)
 INTEGER: 1