hereisgoes Posted March 1, 2012 Share Posted March 1, 2012 Hi guys. So I have a little coding down but I am stuck on this problem: /* Using only a array and a foreach loop, write a program that prints the days of the week *\ $days = array { 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday', }; //This is where I need help with the code echo "$day \r\n"; ?> Thanks in advance! Link to comment https://forums.phpfreaks.com/topic/258068-array-and-foreach-loop-problem-display-days-of-week-help-please/ Share on other sites More sharing options...
Proletarian Posted March 1, 2012 Share Posted March 1, 2012 foreach ($days as $day) { echo $day . "\r\n"; } Link to comment https://forums.phpfreaks.com/topic/258068-array-and-foreach-loop-problem-display-days-of-week-help-please/#findComment-1322862 Share on other sites More sharing options...
AyKay47 Posted March 2, 2012 Share Posted March 2, 2012 Homework? Link to comment https://forums.phpfreaks.com/topic/258068-array-and-foreach-loop-problem-display-days-of-week-help-please/#findComment-1322983 Share on other sites More sharing options...
l0gic Posted March 2, 2012 Share Posted March 2, 2012 Homework? I'd have to say yes, considering his two threads so far. Both of which I'm pretty sure are examples on php.net anyway. Link to comment https://forums.phpfreaks.com/topic/258068-array-and-foreach-loop-problem-display-days-of-week-help-please/#findComment-1323026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.