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

Working on Xampp localhost.

Should I be getting different results when working out the problems on a local server (XAMPP/localhost) than when I work on Treehouses Work Environment? two examples

1. $name = 'Name';

$stringOne = 'Hello $name';

Output on Treehouse Workspace = Hello $name Output on localhost = syntax error variable $name not defined.

2. Escape characters for \n (line break), \cr (carriage return), and \t (tab) do not produce any page break results on localhost.

Steven Pozega
Steven Pozega
14,926 Points

When you view your php file in a browser, you need to use "<br>" instead of "\n". Also, for your $stringOne variable you need to use double quotes("") to use a variable's value inside of a string. Using single quotes the value of $stringOne == 'Hello $name', not 'Hello Name'. Hope this helped!