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 Build a Simple PHP Application Wrapping Up The Project Objects

Pedro nieto Sanchez
Pedro nieto Sanchez
28,169 Points

Hi 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.";

?>

palprimes.php
<?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
Jack McDowell
37,797 Points

Hey 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
Jack McDowell
37,797 Points

No problem, do you mind marking the question as answered? -Jack

Jack McDowell
Jack McDowell
37,797 Points

If 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!)