Advertisement
niammuddin

pagination api mikrotik with php

Jan 6th, 2021
1,200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2. require_once('function.php');
  3. $API = new RouterosAPI();
  4. $API->debug = false;
  5.  
  6. if ($API->connect($ipmikrotik, $usermikrotik, $passmikrotik)) :
  7.  
  8.     $result = $API->comm('/tool/user-manager/user/print', [
  9.         // '' => ''
  10.     ]);
  11.  
  12.     $offset = 1;
  13.     $limit = 100;
  14.  
  15.     $arr = array_slice($result, $offset * $limit, $limit);
  16.  
  17.     echo '<pre>';
  18.     print_r($arr);
  19.  
  20.  
  21.  
  22.  
  23.     // foreach ($arr as $row) {
  24.     //     echo '<pre>';
  25.     //     print_r($row);
  26.     // }
  27.  
  28.  
  29.     $API->disconnect();
  30. endif;
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement