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!
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
My code in the second task does not work and I can't understand why :(
They ask me to add 5 to a Variable : $integerOne and remove 1 from a Variable: integerTwo Where my integers have the value of 1 and 2 :P
My code: <?php $integerOne = 1; $integerTwo = 2;
echo $integerOne, $integerTwo . "<br>"; ?> Here I'm trying to add the values to the integers. Whether I just don't know how to add a value to a Variable or this doesn't work. I've been trying to resolve that ez statement for like 30 minutes...
how can I add and remove a value to a Variable. I thought that this:
$integerOne + 5; $integerTwo - 1; echo $integerOne, $integerTwo; ?> would have worked I watched the video and nothing tells me, how to add or remove from a variable or maybe I missed it :(
Help me ! :) Thanks
<?php $integerOne = 1; $integerTwo = 2; $integerOne + 5; $integerTwo - 1; ?>
Henrik ChristensenPython Web Development Techdegree Student 38,322 Points
<?php $variable_name += value; $variable_name -= value;
It worked :P thanks I thoughts I'd try it, but I wrote =+ instead of += 'cause I thought it was like Variable = Variable + number... Well thank you :P