
API PHP class
268
<?php
require('routeros_api.class.php');
$API = new routeros_api();
$API->debug = true;
if ($API->connect('111.111.111.111', 'LOGIN', 'PASSWORD')) {
$ARRAY = $API->comm('/interface/getall');
print_r($ARRAY);
$API->disconnect();
}
?>
Output
Array
(
[0] => Array
(
[.id] => *1
[name] => ether1
[mtu] => 1500
[type] => ether
[running] => yes
[dynamic] => no
[slave] => no
[comment] =>
[disabled] => no
)
[1] => Array
(
[.id] => *2
[name] => ether2
[mtu] => 1500
[type] => ether
[running] => yes
[dynamic] => no
[slave] => no
[comment] =>
[disabled] => no
)
Komentarze do niniejszej Instrukcji