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
Steve Gotham
11,047 PointsCode Challenge 5 of 7 php objects
I can't figure out why this code won't work! I don't get anything echo'ed, no error or text. Help!
<?php
include_once("class.palprimechecker.php"); $checker = new PalprimeChecker(); $checker->number = 17;
echo "The number " . $checker->number . " "; if($checker->isPalprime()) { echo "is" } else { echo "is not"} echo " a palprime.";
?>
3 Answers
Stone Preston
42,016 PointsYou can place your code in a code block in a forum post by skipping a line and then indenting each line of code by 4 spaces
This is code
This is also code
This is not code
Chase Lee
29,275 PointsHere is a thread on how to display code in the forum./
Randy Hoyt
Treehouse Guest TeacherYou have two lines that are missing semi-colons at the end, this one ...
echo "is"
... and this one ...
echo "is not"
You'll need to add a semi-colon after the echo command, like this:
echo "is";
Does that get it working?
Steve Gotham
11,047 PointsYes it did. Silly mistake. : ) Thanks for the help!