$split = explode(':', $soft[1][$i], 2);
if ( strcmp($split[0], 'Hex-STRING') == 0 ) {
// if ($hex) {
$hex = str_replace(' ', '', $split[1]);
$hex = preg_replace('/[^a-zA-Z0-9]+/', '', $hex);
$hex = hex2bin($hex);
$installed_name[$i] = $hex;
} else{
$data = str_replace('STRING: ', '', $soft[1][$i]);
$data = str_replace('"', '', $data);
$installed_name[$i] = $data;
}
PHP SNMP snmpwalk Hex-STRING和STRING混合解析方法
最新推荐文章于 2024-10-18 06:00:00 发布