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

Arrays

Whats wrong with this code: Now let’s add another letter. Add a fourth element to the array with a value of “R” (my personal favorite). When you preview the code, notice that the count of letters increases and the new letter is added to the list automatically. Important: The code you write in each task should be added to the code written in the previous task. Recheck Work Bummer! Try again!

letters.php

1 <?php 2

3

4 $letters = array (D,G,L,R); 5 echo "My favorite "; 6 echo "3"; 7 echo coun ($letters): 8 foreach($letters as $letter) 9 { 10 echo $letter; 11 } 12 echo "."; 13

14 ?>

1 Answer

Change coun to count.