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 Unit Converter Creating a Unit Conversion Tool

Teacher Russell
Teacher Russell
16,873 Points

Fahrenheit to Celsius converter https://w.trhou.se/ua54aujzlw

I'm new at this, and just want to play with php more before I go adding it to html or anything. Am I silly, or is this a way to do this? https://w.trhou.se/ua54aujzlw

Michael Cockrell
Michael Cockrell
Courses Plus Student 542 Points

i guess thats one way to do it, but you can do all of the math on one line without so many variables. in fact, once you get experience your goal should be to make your code as simple and as light as possible. this eliminates errors that can happen from misspelling or accidentally using the wrong variable. however, i have done what you did many times while trying to troubleshoot certain parts of the code to try and find where the error is.