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