Hi, Can anyone tell me what's the purpose and meaning of "=>" in for each loop? what does => reference between $key & $value ($array as $key => $value) particularly, take the following example code
please check this link http://www.php.net/manual/en/language.types.array.php array format: Array ( key => value) Code (markup): array sample: Array ( 'foo' => 'bar', 'hello' => 'world' ) Code (markup): $key : get the value key, $value : get value. you can use foreach ($array as $row) Code (markup): or foreach (array as $key => $row) Code (markup):
If you need to use the key name, then use =>, if you just need to get value of array then you don't need it.