Advertisement
Eeems

Untitled

May 15th, 2011
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1.     function join($chan){
  2.         $this->send('JOIN',$chan);
  3.         $this->channels[] =  new channel($chan);
  4.         $matches = array();
  5.         $data = '';
  6.         do {
  7.             $data = trim(fgets($this->socket, 128));
  8.             preg_match_all('/:([\S]+) (353) [\S]+ (?:=|@) #([\S]+) :(.+)/',$data,$matches);
  9.             out($data);
  10.             if(count($matches)>0){
  11.                 $t = explode(" ",$matches[4][0]);
  12.                 print_r($t);
  13.                 foreach($t as $u){
  14.                     out('Adding user: '.trim($u));
  15.                     $this->channels[count($this->channels)-1]->addUser(trim($t[$u]));
  16.                 }
  17.             }
  18.         } while(count($matches) < 1);
  19.        
  20.         print_r($this->channels);
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement