dmirsch Posted September 28, 2011 Share Posted September 28, 2011 What does the square bracketed variable mean in the line of code below? function draw_calendar($month,$year,$events = array()){ // coding removed here... $event_day = $year.'-'.$month.'-'.$list_day; if(isset($events[$event_day])) { foreach($events[$event_day] as $event) { $calendar.= '<div class="event">'.$event['EventTitle'].'</div>'; //^this is where we put the performance info } } else { $calendar.= str_repeat('<p> </p>',2); //^this is where we have blanks if an event_day <> list_day } Quote Link to comment https://forums.phpfreaks.com/topic/248050-what-does-this-structure-in-php-mean-variablevariable2/ Share on other sites More sharing options...
dougjohnson Posted September 28, 2011 Share Posted September 28, 2011 I think that's an array. arrayname[index] Quote Link to comment https://forums.phpfreaks.com/topic/248050-what-does-this-structure-in-php-mean-variablevariable2/#findComment-1273634 Share on other sites More sharing options...
dmirsch Posted September 28, 2011 Author Share Posted September 28, 2011 So is it then that the variable $events is the array and $event_day is the specific row of that array? Quote Link to comment https://forums.phpfreaks.com/topic/248050-what-does-this-structure-in-php-mean-variablevariable2/#findComment-1273640 Share on other sites More sharing options...
Zane Posted September 28, 2011 Share Posted September 28, 2011 So is it then that the variable $events is the array and $event_day is the specific row of that array? Indeed. Quote Link to comment https://forums.phpfreaks.com/topic/248050-what-does-this-structure-in-php-mean-variablevariable2/#findComment-1273670 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.