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 Enhancing a Simple PHP Application Integrating Validation Errors Displaying the Error Message

$error_message variable an array

when making the $error_message variable an array. Why didn't you set the $error_message = array() as the holder array first?

1 Answer

I don't think he made it into an array at any point. Changing it to an array is only part of the extra credit.

But you are correct in that if you want to make it an array, you would want to first declare it as an empty array first and fill it up.