Thursday, 19 December 2019

PHP - Ampersand before the variable in foreach loop


Possible Duplicate:
Reference - What does this symbol mean in PHP?






I need to know why we use ampersand before the variable in foreach loop




foreach ($wishdets as $wishes => &$wishesarray) {
foreach ($wishesarray as $categories => &$categoriesarray) {

}
}

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print ...