hw_whoDescriptionhw_who() queries the Hyperwave server for information about all connected users, and returns an array of the data gathered. The indexed array returned contains one array for each connected user, and each of these arrays contains the following elements:
ExampleExample 526. Show information about connected users if ($user_info = hw_who($hw_link)) { reset($user_info); echo <<<EOT <table border="1"> <caption>Connected users</caption> <thead> <tr> <th>ID</th> <th>Name</th> <th>System</th> <th>Online since</th> <th>Total time online</th> </tr> </thead> <tbody> EOT; foreach ($user_info as $user) { echo <<<EOT <tr> <td>$user[id]</td> <td>$user[name]</td> <td>$user[system]</td> <td>$user[onSinceDate] $user[onSinceTime]</td> <td>$user[TotalTime]</td> </tr> EOT; } echo <<<EOT </tbody> </table> EOT; } else { echo "Could not get user information.<br />\n"; }
PHP Functions Essential Reference. Copyright © 2002 by New Riders Publishing
(Authors: Zak Greant, Graeme Merrall, Torben Wilson, Brett Michlitsch).
This material may be distributed only subject to the terms and conditions set forth
in the Open Publication License, v1.0 or later (the latest version is presently available at
http://www.opencontent.org/openpub/).
The authors of this book have elected not to choose any options under the OPL. This online book was obtained
from http://www.fooassociates.com/phpfer/
and is designed to provide information about the PHP programming language, focusing on PHP version 4.0.4
for the most part. The information is provided on an as-is basis, and no warranty or fitness is implied. All
persons and entities shall have neither liability nor responsibility to any person or entity with respect to
any loss or damage arising from the information contained in this book.
|