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 Manipulating Numbers

Brane Opačič
Brane Opačič
6,686 Points

Hi! .. Please help! Why doesn't my code work? It displays an error: "Are you sure you are multiplying correctly?"

Here is my php code:

<?php

//Place your code below this comment $integerOne = 1; $integerTwo = 2; $integerOne = $integerOne + 5; --$integerTwo; $floatOne = 1.5; $result = $integerOne * $floatOne; echo "The result is: $result";

?>

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Your code does work. But it's a little fancier than what they asked for :smiley: In the last echo where you're displaying the result, they just want it to print out the number. You are echoing out a "The result is: "which is causing the challenge to fail. So if I copy/paste your code and just change the last echo, it passes! Take a look:

echo $result;

:information_source: It's always a good idea when doing these challenges to try not to do anything they don't explicitly ask for. Even if functional, it can cause the challenge to fail.

Hope this helps! :sparkles:

Brane Opačič
Brane Opačič
6,686 Points

Thank you so much for a great and fast response! All is clear now :)