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 Booleans

Vince Mendella
Vince Mendella
6,480 Points

\n not working on Mac.

I have tried the code for "php-basics-s3v4" and I get a blank white screen when I use the \n. I have even downloaded the code from the site and tried it and it won't work. Any thoughts on why \n won't work? Mac 10.12.4 MAMP 3.5.

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Vince,

Without seeing the entire code, this is just a guess. But, I have found that a white screen usually means you are missing a semi-colon somewhere in the code.

Double check your code for a missing one.

Keep Coding! :dizzy:

Vince Mendella
Vince Mendella
6,480 Points

I had actually had the \n outside of the quotes. Tried it now and it works fine. I am using Sublime text instead of the workspaces. Not sure if that is good or not.

Please note that new lines will not be visible in the browser window unless you view the source of the page. In order to create a visible new line inside a browser, use echo nl2br("text here \n more text \r\n even more text");