<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<refentry id="function.ircg-list">
   <refnamediv>
    <refname>ircg_list</refname>
    <refpurpose>List topic/user count of channel(s)</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <methodsynopsis>
      <type>bool</type> <methodname>ircg_list</methodname>
      <methodparam><type>resource</type> <parameter>connection</parameter></methodparam>
      <methodparam><type>string</type> <parameter>channel</parameter></methodparam>
    </methodsynopsis>
    <simpara>
     <function>ircg_list</function> will request a list of users in the <variable>channel</variable>. The answer is sent to the output defined by <function>ircg_set_file</function> or <function>ircg_set_current</function>. Returns <literal>TRUE</literal> on success.
    </simpara>
    <para>
     <example>
      <title>Usage</title>
      <programlisting role="php">
<![CDATA[
// connect to server with nick, ip (!) and port (6667)
$id = ircg_pconnect($nickname, $ip, $port);

// set to output to a file
ircg_set_file($id, 'irc_output.html');

// try to join a channel
if (!ircg_join($id, $channel))
{
	echo 'Cannot /join $channel<br />';
}

// send list command
ircg_list($id, $channel);

// wait for output to arrive
sleep(5);

// disconnect
ircg_disconnect($id,'Bye World');

// output everything
readfile('irc_output.html');

/* output:
....
Channel #channel has n users and the topic is 'Topic'
End of LIST
....
*/
]]>
      </programlisting>
     </example>
    </para>
    <simpara>
     See also <function>ircg_set_file</function>, <function>ircg_set_current</function>, <function>ircg_who</function>.
    </simpara>
   </refsect1>
  </refentry>