// $this->db->select('ip'); // $query = $this->db->get('ip_server1')->result_array(); // $prefix = array(); // foreach ($query as $value) { // $prefix[] = $value['ip']; // } // // print_r($prefix); // while (in_array(($lastip = rand(10, 13)), $prefix)); // $ip = '172.16.1.' . $lastip; // echo $ip; // $hostname = '192.168.1.1'; // $username = '1234'; // $password = '1234'; // if ($this->routerosapi->connect($hostname, $username, $password)) { // // get informastion from mikrotik before create users ppp // $this->routerosapi->write('/ppp/secret/print', false); // $this->routerosapi->write('=.proplist=remote-address'); // $iplist = $this->routerosapi->read(); // $this->routerosapi->disconnect(); // $prefix = array(); // foreach ($iplist as $value) { // $data = $value['remote-address']; // $split = explode('.', $data); // $prefix[] = @$split[3]; // } // print_r($prefix); // }