This forum is now read-only. Please use our new forums at discuss.codecademy.com.

For Loops in PHP Forum

View Course

288 points
6dd0ac3008b4ba7ad20e4ccc7891c140?s=140&d=retro
Submitted by
Dona V
over 1 year ago

Why unset $lang?

Hello guys!
In the foreach part(5/7) of the PHP course, I can`t underestand why at the end of every foreach loop the variable $lang is being unset. Any ideas?
Some code:
foreach($langs as $lang){
......
}
unset($lang);


0 votes

permalink

echo each element from an array

537 points
13ee58ae68f8613e447cd4a0eaa1b9de?s=140&d=retro
Submitted by
Kamalaksha
over 1 year ago