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

Nicholas McArthur
Nicholas McArthur
3,018 Points

add 5 to integerOne and subtract 1 from integerTwo Not sure what im doing wrong and there is no

Not sure what Im doing wrong, I have watched the videos leading up to this and i have been unable to figure this out.

index.php
<?php

//Place your code below this comment


$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;

var_dump( $integerOne );
var_dump( 1 ); 
var_dump( "1" );
var_dump( $integerOne + $integerTwo + $integerTwo );

var_dump( $integertwo );
var_dump( 2 );
var_dump( "2");
var_dump( $integertwo - $integerOne );
?>

1 Answer

jamesjones21
jamesjones21
9,260 Points

you can do the following when adding or subtracting to another variable with += or -= operators;

$integerTwo = 2;
$floatOne = 1.5;

$integerOne += 5;
$integerTwo -= 1;

$multiply = $integerOne * $floatOne;

echo $multiply;
Nicholas McArthur
Nicholas McArthur
3,018 Points

Thank you James!

That is a lot simpler then what I was thinking.

jamesjones21
jamesjones21
9,260 Points

no problem at all, the challenges are sometimes confusing, which I think they should be reworded in ways :)