it's the "foreach" that's doing it.
Basically it says "here's an array ($users). I want you to look at each element in that array, and whatever value is stored in that element I will call $val."
what happens inbetween the { and } is what it does once it's looked at each element. so in this case it just echo's it out.
I'm not sure what you mean by your last bit, but I think you're just asking about arrays in general. in which case, there are various options open to you. for example:
<? echo $users[0]; ?>
will give you the first item in the array (note the index (the bit in the []) starts from zero.
alternatively, you could do something like:
<?
for($a=0;$a<4:$a++)
{
echo $users[$a];
}
?>
which would echo out $users[0], $users[1]... $users[3].
does that help at all?