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 (Retired) PHP Datatypes Integers

Comments appear

When I use "//" the comments appear. code: <ul> <li><?php echo $one + $two - $three ?></li> // Returns a zero // <li><?php echo gettype($one) ?></li> //<li><?php echo gettype($string_one) ?></li> // no difference between the two have to add gettype. "gettype" allows to test what some value is. </ul>

Web Display:
11
0 // Returns a zero // integer // string // no difference between the two have to add gettype. "gettype" allows to test what some value is.

what is the cause of the read out?

2 Answers

Kevin Kenger
Kevin Kenger
32,834 Points

Hey Dale,

The two slashes is the appropriate syntax for when you're inside PHP tags. You're trying to use them inside HTML tags.

html comments work like this

<!-- something to comment -->
Sergey Podgornyy
Sergey Podgornyy
20,660 Points

To comment html code you need to use

<!-- ... -->

. More info you can find here - http://www.w3schools.com/tags/tag_comment.asp

If you want to add comment on PHP way, you need to write comments inside PHP tags

<?php ... ?>