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 trialPedro nieto Sanchez
28,169 PointsHi guys I am a bit lost here, can anyone help me?
<?php
require_once('class.palprimechecker.php');
$checker = new PalprimeChecker; $number = 17; $checker -> number = $number; $palprimer = $checker -> isPalprimer();
echo "The number " . $number;
if ($palprimer == TRUE) { echo "is"} else {echo "is not"}; echo " a palprime.";
?>
<?php
require_once('class.palprimechecker.php');
$checker = new PalprimeChecker;
$number = 17;
$checker -> number = $number;
$palprimer = $checker -> isPalprimer();
echo "The number " . $number;
if ($palprimer == TRUE) {
echo "is"}
else {echo "is not"};
echo " a palprime.";
?>
3 Answers
Jack McDowell
37,797 PointsHey there, at step 5/7 you would have the following:
<?php
require_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."; ?>
//Or like this the way you had your first answers set up:
<?php
require_once('class.palprimechecker.php');
$checker = new PalprimeChecker;
$number = 17;
$checker -> number = $number;
echo "The number " . $number;
if($checker->isPalprime())
{ echo "is";
}else{ echo "is not";
}
echo " a palprime."; ?>
Jack McDowell
37,797 PointsNo problem, do you mind marking the question as answered? -Jack
Pedro nieto Sanchez
28,169 PointsHow can i do it?
Jack McDowell
37,797 PointsIf you mark the answer as best answer it marks it as complete (but I haven't posted a question yet so I'm not sure!)
Pedro nieto Sanchez
28,169 PointsDone. THanks.