Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 ... ?>