Possible Duplicate:
What does $k => $v in foreach($ex as $k=>$v) mean?
I am trying to understand what this means:
foreach($this->domains as $domain=>$users) {
// some code...
}
I understand $this->domains is an array that foreach will index over. But what does as $domain=>$users mean? I have only seen the => operator used in an array to set (key, value) pairs. The class has a member called $domain, but I assume that would be accessed as $this->domain.
The
=>operator specifies an association. So assuming$this->domainsis an array,$domainwill be the key, and$userswill be the value.Outputs:
(In your example,
$usersis probably an array of users);