Advertisement
Eeems

Untitled

May 15th, 2011
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 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.             print_r($matches);
  11.             if(count($matches)>0&&isset($matches[4])&&$matches[4][0]!=''){
  12.                 out('"'.$matches[4][0].'"');
  13.                 $t = explode(" ",$matches[4][0]);
  14.                 foreach($t as $u){
  15.                     out('Adding user: '.trim($u));
  16.                     $this->channels[count($this->channels)-1]->addUser(trim($u));
  17.                 }
  18.             }else{
  19.                 $matches = array();
  20.             }
  21.         }while(count($matches)<1);
  22.        
  23.         print_r($this->channels);
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement