Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics Daily Exercise Program Daily Exercise Program

Why you didn't explain "foreach" and "arrays" before this exercise?

I mean the best practice would be to create a Array from all the "exercises" and then test each inside a foreach loop. People might think that this is the way it's done :x

2 Answers

Hey Damian

It appears you are coming from a background in programming. These courses are designed for any previous experience to jump in and start learning PHP. I wouldn't ask a student just learning about strings and conditionals to understand a foreach or while block. In coding there is a ton to learn of best practices such as to coding to an interface, class autoloading, user input sanitation, don't repeat yourself, and more. But we cannot learn better ways without knowing the basics.

If you didn't like my answer, you can try the teacher, Alena Holligan, or emailing TeamTreeHouse help@teamtreehouse.com.

Kevin Gates
Kevin Gates
15,053 Points

Agreed. This is a baby steps process and presuming PHP is someone's first language and wants to help them understand the basic principles before using the more advanced and efficient methods.

As mentioned several times in these lessons, they were only covering scalar types and if/else/elseif conditionals up to this point. Scalar types: bool, int, float, string.