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 Integer + & -

Okay, math was never my subject, but I'm trying to figure out how to add and subtract integers on this PHP quiz I'm doing. I'm also trying to figure out how to post a picture on here as I did take a screenshot.

This question will be a lot easier to understand if I can get a picture on here.

Thanks, a lot!

Screenshots are difficult to work with. One of the preferred means of sharing code is to copy/paste your code and format it using markdown. See the Markdown Cheatsheet link at the bottom for how to do so.

4 Answers

I can read your code. But if you want to format with markdown you can place three back ticks followed by php before your code and three back ticks at the end of your code. Then it will look like this:

<?php

//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;
var_dump ($integerOne + 5);
var_dump ($integerTwo -1); 

?>

As far as your question goes the challenge expects you to update the values. var_dump will only display them. Here you can use either of the following

<?php

//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;

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

?>

or

<?php

//Place your code below this comment
$integerOne = 1;
$integerTwo = 2;
$floatOne = 1.5;

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

?>

Sweet! Thanks

Thanks, Kris!

I've got a few things going on for the next several hours but I'll try and get it up here as soon as I can.

Gracias

Okay, here's the question:

Add 5 to $integerOne. Subtract 1 from $integerTwo.

And here's the code:

<?php

//Place your code below this comment $integerOne = 1; $integerTwo = 2; $floatOne = 1.5; var_dump ($integerOne + 5); var_dump ($integerTwo -1); ?>

Let me know if that's clear enough.