I have a database call and I\'m trying to figure out what the $key => $value does in a foreach loop.
$key => $value
foreach
The reason I ask is because both these
Say you have an array like this:
$array = (0=>'123',1=>'abc','test'=>'hi there!')
In your foreach loop, each loop would be:
$key = 0, $value = '123' $key = 1, $value = 'abc' $key = 'test', $value = 'hi there!'
It's great for those times when you need to know the array key.