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
 
<snmp_read_mibsnmp_set_oid_numeric_print>
^SNMP FunctionsLast updated: Mon, 26 Oct 2026

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

Description

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.

Parameters

enable

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

Return Values

Always returns true.

Changelog

Version Description
8.2.0 The return type is true now; previously, it was bool.

Examples

Example #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


<snmp_read_mibsnmp_set_oid_numeric_print>
^SNMP FunctionsLast updated: Mon, 26 Oct 2026