$fh = fopen($file, "r");
while ($info = fgets($fh, 4096)) {
ereg ("(.*)(:)(.*)", $info, $username);
$singleuser = $username[1];
$singlepass = $username[3];
$users[] = array($singleuser, $singlepass);
echo "$users[0] <br>";
} //endwhile
fclose($fh);
// find out what is in array
print "<pre>";
print_r($users);
print "</pre>";
debug with print_r()
also, personal preference here, makes the array more meaningful to me:
$users[] = array('user' => $singleuser,
'pass' => $singlepass
);
and to get the values back out,
for($i=0;$i<sizeof($users);$i++) {
printf("user: %s<br>pass: %s<hr>",
$users[$i]['user'],
$users[$i]['pass']
);
}