Hi! I'm having trouble with the following code: $sysip = "212.163.45.28"; $snmpcomunity = "dataspain1724"; for($i=1;$i < 256;$i++) { $name = snmpget($sysip,$snmpcomunity, "ifDescr.".$i); $status = snmpget($sysip,$snmpcomunity, "ifOperStatus.".$i); $data[$i]['Name'] = $name; $data[$i]['Status'] = $status; $html=$sign->parsetotable_ports($data,"mytddata","MyFieldName","MyOpenPort","MyClosedPort"); PHP: The parsetotable function: function parsetotable_ports($result,$style,$style2) { for($i=0; $i < sizeof($result); $i++) { if( $i == 0 ) { $RES .= "<tr>\n"; for($j=0; $j < sizeof($result[$i]); $j++) { $RES .= "<td class=\"".$style2."\">".key($result[$i])."</td>\n"; next($result[$i]); } reset($result[$i]); //Here's the error $RES .= "</tr>\n"; } PHP: ... The error is: Passed variable is not an array or object in the reset function of the function parsetotable_ports. Has anyone an idea? Thanks. Beni.
$result[0] doesn't exist. thats where it is starting.... try changing: for($i=1;$i < 256;$i++) { to for($i=0;$i < 256;$i++) { or rather: for($i=0;$i < 255;$i++) {