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 trialJoe Elia
552 Points[SOLVED] Remove extra Comma for last Author?
How would you remove the extra ", " for the last author in the string array.
Joe Elia
552 PointsOkay I understand the 'implode()' part, but it will still add a ", " to the last author ex: "Sarah Jean, Mike Jones, Carrie Blue, ". How would you remove ", " at the end of only "Carrie Blue.
Jason Anello
Courses Plus Student 94,610 PointsHi Joe,
There must be something else going on then. implode() won't add the glue string after the last element in the array. Only between each element.
I don't see a trailing comma in the video after the authors and I also don't have one in my personal files.
Does this happen for you on all 4 books? Change the id in the url to one of the other books.
Can you post the td
that contains the author output? Maybe even post what one of your author arrays looks like in the data.php file.
Joe Elia
552 PointsOh y'all are right, I didn't see that the authors went down to the line below........
Jason Anello
Courses Plus Student 94,610 PointsThat makes sense. Glad you figured it out.
added [SOLVED] to title
Emily DeJoode
5,086 PointsEmily DeJoode
5,086 PointsIts in the video, just before the 4:00 mark. Using implode() on the array.