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 Integers

running the php in console

Hi, after saving the file the variable name is still showing in console where could I be getting it wrong

3 Answers

f lsze
f lsze
8,021 Points

Hello, the error is that the variable you are echoing is using a hyphen $num-one while the one that you set uses an underscore $num_one. Ensure they are the same and give it another try : )

f lsze
f lsze
8,021 Points

In fact, hyphens are not allowed in variable names at all. So you should change $num-three to $num_three. Also it appears you added a space between <? and php, there can be no space, it has to be <?php.

thank you very much got it right this time

f lsze
f lsze
8,021 Points

Please paste your code here so we could take a look. Keep in mind that in the console since you did not specify a new line character, the variable shows up right BEFORE the "treehouse:~/workspace$" prompt.

<?php
$num_one = 1;
$num_two = 2;
$num-three = 3;

echo $num-one;
?>