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 trialBr3eZy [Braah!]
Full Stack JavaScript Techdegree Student 4,263 PointsMy 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:
<?php
$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;
?>
1 Answer
Henrik Christensen
Python Web Development Techdegree Student 38,322 Pointstry this:
<?php
$variable_name += value;
$variable_name -= value;
Br3eZy [Braah!]
Full Stack JavaScript Techdegree Student 4,263 PointsBr3eZy [Braah!]
Full Stack JavaScript Techdegree Student 4,263 PointsIt 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