Re: User listing..
| From: | stephan dot schoell at chhos dot mail dot abb dot com | Date: | Thu, 20 Jul 2000 12:48:38 +0000 |
| Subject: | Re: User listing.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-7406@lists.php.net to get a copy of this message | ||
Daniel, try:
function dispUser() {
exec("users",$usr);
while (list($key,$username)=each($usr)) {
switch ($username) {
case "ben":
echo"..........";
break;
case "dover":
echo"..........";
break;
}
}
}
I haven't checked the code though, but the essence is the loop through all the
elements of the array $usr (->manual->list()).
HTH
-Steff
**********************
<?
function dispUsr() {
exec("users", $usr);
if (in_array("ben", $usr)) {
echo "<a href='http://www.somesite.org'>Ben</a>";
} elseif (in_array("dover", $usr)) {
echo "<a href='http://www.blah.net'>Dover</a>";
}
.....
} else {
echo "none";
}
}
?>