getElement('success', $con->connect())) { //If connection was successfully $con->login($user, $password); //Login into query $con->selectServer($port); //Select server by port. (You can use server id instead of port) $con->setName($name); //Set the bot's name while(1) { $date = strtotime($target) - time(); //Convert string to time and count remaining date $days = floor($date / 86400); //Count remaining days $hours = floor(($date % 86400) / 3600); //Count remaining hours $cstr = "[cspacer]{$days}d and {$hours}h remaining..."; //Channel's name string (Use '$days' for remaining days and '$hours' for remaining hours) $con -> channelEdit($cid, array('channel_name' => $cstr)); //Set channel's name sleep(60); //Run the loop every 60seconds(1minute) and check date. (Edit it optionaly) } } else { die("Unable to connect to $address:$port..."); //If connection was not successfully } ?>